#include <bits/stdc++.h>
using namespace std;

int fact (int n) {
    return (n*(n-1)*(n-2)/6);
}
vector<vector<int> > tacke;
int res=0;
void pisi (int k, int x, int y) {
    if (k==0) return;
    int i=(int)(pow(6*(double)k,0.333333))+2;
    while (fact(i)>(int)k) {
        i--;
        }
    int t;
    for (t=x; t<x+i; t++) {
        tacke[0].push_back(t);
        tacke[1].push_back(y);
        res+=1;
    }
    pisi (k-fact(i),t,y+1);
}
int main() {
    int n;
    scanf("%d",&n);
    tacke.resize(2);
    pisi(n,-pow(10,9),-pow(10,9));
    cout<<res<<endl;
    for (int i=0; i<res; i++) {
        cout<<tacke[0][i]<<" "<<tacke[1][i]<<endl;
    }
}