#include <bits/stdc++.h>
typedef long long ll;

const int MAX_N = 1e6;
const int INF = 1e9;

std::vector<int> len[MAX_N];
std::vector<std::pair<int, int>> ans;

bool viz[MAX_N];

int main () {

    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    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);
    }

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

    /*
    for( int i=0 ; i<n ; i++ ){
        std::cerr<<"\n"<<i<<": ";
        for( int j : len[i] ) std::cerr<<j<<" ";
    }
    */

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

        for( int j=0 ; j<curr.size() ; j+=2 )
            ans.push_back({curr[j], curr[j+1]});

    //    std::cerr<<"!"<<currNum<<"\n";
        num += currNum/2;
    }

    std::vector<int> single;

    for( int i=0 ; i<n ; i++ ) if( !viz[i] ) single.push_back( i );

    /*
    std::cerr<<"\n\n";
    for( int j : single ) std::cerr<<j<<" ";
    std::cerr<<"\n\n";
    */

    std::cout<<num<<"\n";
    for( auto j : ans )
        std::cout<<j.first+1<<" "<<j.second+1<<"\n";

    return 0;
}
