using System;

namespace _3._Sazvezdja_css
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rand = new Random();
            double x = Convert.ToInt64(Console.ReadLine());
            int xx, yy;

            if (x >= 8)
            {
                int k = 0;
                double[] niz = new double[68];

                for (int n = 3; n < 69; n++)
                {
                    niz[n - 1] = kocka(n);
                    if (niz[n - 1] > x)
                    {
                        k = n - 1;
                        break;
                    }
                    else if (niz[n - 1] == x)
                    {
                        k = n;
                        break;
                    }
                }
                int fali = Convert.ToInt32(x - kocka(k));
                Console.WriteLine((k * k) + (fali * 3));
                for (int i = 0; i < k; i++)
                {
                    for (int j = 0; j < k; j++)
                    {
                        Console.WriteLine(i + " " + j);
                    }
                }
                for (int i = 0; i < fali; i++)
                {
                    xx = rand.Next(-99999999, -9999);
                    yy = rand.Next(-99999999, -9999);

                    Console.WriteLine(xx + " " + (yy + 1));
                    Console.WriteLine(xx + " " + (yy + 2));
                    Console.WriteLine(xx + " " + (yy + 3));
                }
            }
            else
            {
                Console.WriteLine(x*3);
                for(int i = 0; i < x; i++)
                {
                    xx = rand.Next(-99999999, -9999);
                    yy = rand.Next(-99999999, -9999);

                    Console.WriteLine(xx + " " + (yy + 1));
                    Console.WriteLine(xx + " " + (yy + 2));
                    Console.WriteLine(xx + " " + (yy + 3));
                }
            }

        }

        static public double kocka(double n)
        {
            double ravne = 2 * n * komb(n);
            double kose = 2 * komb(n);
            for(double i = n-1; i >= 3; i--)
            {
                kose += 4 * komb(i);
            }
            return ravne + kose;
        }
        static public double fact(double n)
        {
            if (n == 1 || n == 0) return 1;
            else return n * fact(n - 1);
        }

        static public double komb(double n)
        {
            return fact(n) / (6 * fact(n - 3));
        }
    }
}