#include <iostream>
using namespace std;

pair<int, int> a[2001];

int main()
{
    int k;
    cin >> k;
    int k1 = k;
    int x = 0, y = 0, d = 1, br1 = 11, br2 = 0;
    while (k > 0) {
        int suma = 1;
        int l = 4;
        while (l * suma / (l - 3) <= k) {
            suma = suma * l;
            suma /= (l - 3);
            l++;
        }
        int br = l - 2;
        d += br;
        if (k == k1) {
            for (int i = 1; i <= br; i++) {
                x++;
                a[br2].first = x;
                a[br2++].second = 0;
            }
        }
        else {
            for (int i = 1; i <= br; i++) {
                x += br1;
                y++;
                a[br2].first = x;
                a[br2++].second = y;
            }
            br1--;
        }
        k -= suma;
    }
    cout << d << endl;
    cout << 0 << " " << 0 << endl;
    for (int i = 0; i < br2; i++)
        cout << a[i].first << " " << a[i].second << endl;
    return 0;
}