#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define mid(l, r) ((l)+(r))/2
#define len(a) (a).length()
#define sz(a) (a).size()
#define xx first
#define yy second
#define inf int(2e9)
#define ff(i, a, b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i, a, b) for(int (i) = (a); (i) >= (b); --(i))


using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

template<class T>
void print(const T niz[], const int siz)
{
    for(int i=0;i<siz;i++)
        cout << niz[i] << " ";
    cout << endl;
}

ll n;
bool ista = 0;
vector<pii>sol;
int lastlvl = 0;
int lastdod = 0;
int lastx = 0;
void ubaci(int kolko){
    if(!ista){
        for(int i=0; i<=kolko - 1; i++){
            sol.pb({i,i});
        }
        lastlvl = kolko-1;
        lastdod = 1;
        lastx = kolko-1;
        ista = 1;
    }
    else{
        kolko--;
        int trlvl = lastlvl*2 + 1;
        lastdod = lastdod + 1;
        int trx = trlvl * lastdod;
        for(int i=0; i<kolko; i++){
            sol.pb({trx,trlvl});
            trx += lastdod;
            trlvl++;
        }
        lastlvl = trlvl;
    }
}
ll nck(ll x){
    ll sta = (x) * (x - 1) * (x - 2);
    sta /= 6;
    return sta;
}
ll pomn;
bool kol(pii a, pii b, pii c){
    ll prvi = b.yy - a.yy;
    ll drugi = b.xx - a.xx;
    ll treci = c.yy - b.yy;
    ll cet = c.xx - b.xx;
    if(prvi * cet == drugi * treci)return 1;
    else return 0;
}
void check(){
    int m = sol.size();
    ll res = 0;
    for(auto c:sol){
        if(abs(c.xx) > 1e9 || abs(c.yy) >1e9){
            cout << "debilu\n";
            return;
        }
    }
    ff(i,0,m - 1){
        ff(j,i+1,m-1){
            ff(k,j+1,m-1){
                if(kol(sol[i],sol[j],sol[k]))res++;
            }
        }
    }
    cout << res << endl;
    if(res == pomn)cout << "dobarsi\n";
    else cout << "debilu\n";
}
int main()
{
    //cout << kol({0,0}, {1,1}, {2,2}) << endl;
    ios_base::sync_with_stdio(false);
    cin >> n;
    pomn = n;
    ll i = 1005;
    while(n > 0){
        ll sta = nck(i);
        if(sta > n){
            i--;
            continue;
        }
        n -= sta;
        ubaci(i);
    }
    //check();
    cout << sol.size() << endl;
    for(auto c:sol) cout << c.xx  << " " << c.yy << endl;
    return 0;
}