#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

const int MAXN = 1e6+6;
vector <int> G[MAXN];

bool used[MAXN];

int main ()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        int a, b;
        cin >> a >> b;
        G[a].push_back(i);
        G[b].push_back(i);
    }

//    cerr << "===" << endl;
//
//    for (int i = 1; i <= n; i++)
//    {
//        cerr << i << ": ";
//        for (int j = 0; j < G[i].size(); j++)
//        {
//            cerr << G[i][j] << " ";
//        }
//        cerr << endl;
//    }
//
//    cerr << "---" << endl;

    vector < pair<int,int> > sol;

    int fi = 0;
    for (int i = 1; i <= n; i++)
    {
        int br = 0;
        for (int j = 0; j < G[i].size(); j++)
        {
            int cur = G[i][j];
            if (used[cur]) continue;
            br++;
            if (br % 2 == 0)
            {
                sol.push_back({fi, cur});
                used[cur] = 1;
                used[fi] = 1;
            }
            else fi = cur;
        }
    }

//    cout << sol.size() << endl;
    cout << m/2 << endl;
    for (int i = 0; i < sol.size(); i++)
    {
        cout << sol[i].first << " " << sol[i].second << endl;
    }

    return 0;
}
/***
10 15
4 9
9 5
4 6
6 8
10 1
1 4
3 1
3 9
5 6
5 2
2 7
3 7
10 8
2 10
7 8

------

7
2 9
1 6
3 4
7 5
10 14
13 15
11 12




10 9
1 5
2 3
3 6
2 9
7 6
1 4
4 9
9 7
5 9


*/

