#include <bits/stdc++.h>

const int MAX_N = 1e6;

std::vector<int> len[MAX_N];

bool viz[MAX_N];

int main () {

    int n, m;
    std::cin>>n>>m;

    for( int i=0 ; i<m ; i++ ){
        int a, b;
        std::cin>>a>>b;
        a--; b--;
        len[a].push_back(i);
        len[b].push_back(i);
    }

    std::cout<<m/2<<"\n";

    for( int i=0 ; i<n ; i++ ) std::sort(len[i].begin(), len[i].end());

    for( int i=0 ; i<n ; i++ ){
        int currNum = 0;
        std::vector<int> curr;
        curr.clear();
        int last = -1;
        for( int j : len[i] ){
            if( !viz[j] ){
                viz[j] = true;
                currNum ++;
                curr.push_back(j);
                last = j;
            }
        }
        if( currNum % 2 != 0 ){
            currNum --;
            if( !curr.empty() ) curr.pop_back();
            viz[last] = false;
        }
        for( int j=0 ; j<curr.size() ; j+=2 )
            std::cout<<curr[j]<<" "<<curr[j+1]<<"\n";
    }

    return 0;
}
