#include <iostream>
#include <stdio.h>
#include <vector>

#define MAXN 2000

using namespace std;

int nnad3(int n)
{
    return n*(n-1)*(n-2)/6;
}

void ispis(int x[],int xs)
{
    for(int i=0;i<xs;i++)
        cout<<i<<" "<<x[i]<<endl;
}

void ispis(vector <int> &v)
{
    for(int i=0;i<v.size();i++)
        cout<<v[i]<<" ";
}

int main()
{
    int x[MAXN],xs;
    vector <int> v;
    int k,pocx,pocy,sk,suma;
    cin>>k;
    x[0]=x[1]=x[2]=0;
    for(xs=3;xs<1000;xs++)
    {
        x[xs]=nnad3(xs);
        if(x[xs]>k)
            break;
    }
    /*cout<<xs<<endl;
    ispis(x,xs+1);*/
    for(int i=xs-1;i>=0;i--)
    {
        if(k==0)
            break;
        if(x[i]<=k){
            v.push_back(i);
            k-=x[i];
            i++;
        }
    }
    /*cout<<k<<endl;
    ispis(v);*/
    pocx=1;
    pocy=0;
    suma=1;
    for(int i=0;i<v.size();i++)
        suma+=v[i]-1;
    cout<<suma<<endl;
    cout<<0<<" "<<0<<endl;
    for(int i=0;i<v.size();i++)
    {
        for(int j=1;j<v[i];j++)
        {
            cout<<pocx<<" "<<pocy<<endl;
            pocx++;
            pocy+=i;
        }
        pocy++;
    }

    return 0;
}