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

int main() {
	int k, x=0, y=0, c=0, cn=0, d=0;
	vector<pair<int, int> > a;
	cin >> k;
	while (d < k)
	{
		a.push_back(make_pair(x, y));
		x++, c++;
		if (c == 3)
			cn = 1;
		else if (c > 3)
		{
			cn *= c;
			cn /= c-3;
		}
		if ((c >= 3) && (k < d + (cn*(c+1))/(c-2)))
		{
			y++;
			d += cn;
			cn = c = 0;
		}
	}
	cout << a.size() << endl;
	for (auto it: a)
	{
		printf("%i %i\n", it.first, it.second);
	}
	return 0;
}