#include<bits/stdc++.h>

using namespace std;
#define pb push_back

vector<int> r;
int bk[650],j;
int main()
{
    int k;
    cin >> k;
    for(int i=3;i<601;i++)
    {
        bk[i]=(i*(i-1)*(i-2))/6;
        if(bk[i]>k){
            j=i-1;
            break;
        }

    }
    int ans=j;
    k-=bk[j];
    r.pb(j);
    while(k>0)
    {
        for(int i=3;i<=j+1;i++)
        {
            if(bk[i]>k)
            {
                j=i-1;
                ans+=j;
                r.pb(j);
                break;
            }
        }
        k-=bk[j];
    }
    cout<<ans<<"\n";
    int xi=-100000000,y=-100000000;
    for(auto x:r)
    {
        for(int i=0;i<x;i++)
        {
            cout<<xi<<" "<<y<<"\n";
            xi++;
        }
        y++;
    }
}