#include<iostream>
#include<string>
#include<vector>
using namespace std;
const int MAXM=5*1e3+5;
vector<int>ezik[MAXM];
bool used[MAXM];
int main (){
    int n,m;
    cin>>n>>m;
    int a,b;
    for(int i=1;i<=m;i++){
        cin>>a>>b;
        ezik[a].push_back(i);
        ezik[b].push_back(i);
    }
    /*int dv=0;
    for(int i=1;i<=n;i++){
            for(int j=0;j<ezik[i].size()-1;j+=2){
                if(!used[ezik[i][j]] and !used[ezik[i][j+1]]){
                cout<<ezik[i][j]<<" "<<ezik[i][j+1]<<"\n";
                used[ezik[i][j]]=true;
                used[ezik[i][j+1]]=true;
                dv++;
            }
    }*/
    cout<<(m-m%2)/2<<"\n";
    for(int i=1;i<=n;i++){
            for(int j=0;j<ezik[i].size()-1;j+=2){
                if(!used[ezik[i][j]] and !used[ezik[i][j+1]]){
                cout<<ezik[i][j]<<" "<<ezik[i][j+1]<<"\n";
                used[ezik[i][j]]=true;
                used[ezik[i][j+1]]=true;
                //dv++;
                }
            }
    }
    return 0;
}


