using System;
class Program
{
    static void Main(string[] args)
    {
        string[] combinations = new string[2000];
        int k = int.Parse(Console.ReadLine());
        int s = 0;
        int all = 0;
        int total = 0;
        for(int i=0; s < k; i += 2)
        {
            bool loop = true;
            int n = 0, d = 0, fa = 1;
            while (loop)
            {
                n += fa;
                d += n;
                fa++;
                if (d > (k - s))
                {
                    loop = false;
                    fa--;
                    d -= n;
                    n -= fa;
                }
            }
            s += d;
            for(int j = 0; j < fa + 1; j++)
            {
                combinations[total] += i + " " + j;
                if (j != fa) combinations[total] += Environment.NewLine;
                all++;
            }
            total++;
        }
        Console.WriteLine(all);
        for (int i = 0; i < total; i++)
        {
            Console.WriteLine(combinations[i]);
        }
    }
}