#include<iostream>
#include <vector> 
using namespace std;


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


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);


	int N;

	int x = -999999998;
	int y = -999999998;
	vector<int> numberInLine;


	int xx[2000], yy[2000], c = 0;
	cin >> N;
	int need = N;

	while (need > 2)
	{
		int trajN = 2;
		int getf;
		do
		{
			trajN++;
			getf = getFact(trajN);

		} while (getf < need);

		trajN--;
		getf = getFact(trajN);

		numberInLine.push_back(trajN);
		need -= getf;



	}

	int increment = 20;

	for (int vi = 0; vi < numberInLine.size(); vi++)
	{
		for (int i = 0; i < numberInLine[vi]; i++)
		{


			xx[c] = x;
			yy[c] = y;
			c++;
			x++;
		}
		y += 4;//dobijen broj probom nije bas programerski :)
		if (vi % 1 == 0)
		{
			x += increment;
			increment *= 13;//isto
		}
	}

	if (need == 1)
	{
		xx[c] = x;
		yy[c] = y;
		c++;
		xx[c] = x + 1;
		yy[c] = y;
		c++;
		xx[c] = x + 2;
		yy[c] = y;
		c++;
	}
	else if (need == 2)
	{
		xx[c] = x;
		yy[c] = y;
		c++;
		xx[c] = x + 1;
		yy[c] = y;
		c++;
		xx[c] = x + 2;
		yy[c] = y;
		c++;
		xx[c] = x;
		yy[c] = y - 1;
		c++;
		xx[c] = x;
		yy[c] = y + 1;
		c++;
	}
	cout << c << endl;
	for (int i = 0; i < c; i++)
	{
		cout<<xx[i] << ' ' << yy[i]<<endl;
	}

	cout << endl;
	return 0;
}