using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static int []one(int i,int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] two(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] three(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            Console.WriteLine("1 0");
            Console.WriteLine("2 0");
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] four(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] five(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] six(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            Console.WriteLine("1 0");
            Console.WriteLine("2 0");
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static int[] seven(int i, int j)
        {
            int[] niz = new int[2];
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            j++;
            Console.WriteLine(i + " " + j);
            Console.WriteLine("1 0");
            Console.WriteLine("2 0");
            Console.WriteLine("1 1");
            Console.WriteLine("2 1");
            i++;
            Console.WriteLine(i + " " + j);
            i++;
            Console.WriteLine(i + " " + j);
            niz[0] = i;
            niz[1] = j;
            return niz;
        }
        static void Main(string[] args)
        {

            int k = int.Parse(Console.ReadLine());
            int m = 0;
            int n = 0;
            int l = 0;
            int[] niz = new int[2];
            if (k == 1)
            {
                Console.WriteLine("3");
                niz = one(0, 0);
                
            }
            else if (k == 2)
            {
                Console.WriteLine("5");
                niz = two(0, 0);
            }
            else if (k == 3)
            {
                Console.WriteLine("7");
                niz = three(0, 0);
            }
            else if (k == 4)
            {
                Console.WriteLine("4");
                niz = four(0, 0);
            }
            else if (k == 5)
            {
                Console.WriteLine("6");
                niz = five(0, 0);
            }
            else if (k == 6)
            {
                Console.WriteLine("8");
                niz = six(0, 0);
            }
            else if (k == 7)
            {
                Console.WriteLine("10");
                niz = seven(0, 0);
            }
            else
            {
                int i = 0;
                int j = 0;
                m = k / 8;
                if (k % 8 == 1)
                {
                    l = 3 + 6 * m;
                    Console.WriteLine(l);
                    niz = one(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 2)
                {
                    l = 5 + 6 * m;
                    Console.WriteLine(l);
                    niz = two(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 3)
                {
                    l = 7 + 6 * m;
                    Console.WriteLine(l);
                    niz = three(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 4)
                {
                    l = 4 + 6 * m;
                    Console.WriteLine(l);
                    niz = four(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 5)
                {
                    l = 6 + 6 * m;
                    Console.WriteLine(l);
                    niz = five(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 6)
                {
                    l = 8 + 6 * m;
                    Console.WriteLine(l);
                    niz = six(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                if (k % 8 == 7)
                {
                    l = 10 + 6 * m;
                    Console.WriteLine(l);
                    niz = seven(0, 0);
                    i = niz[0];
                    j = niz[1];
                }
                
                if (k % 8 == 0)
                {
                    l = 1 + 6 * m;
                    Console.WriteLine(l);
                    Console.WriteLine("0 0");
                }
                for (int t = 0; t < m*2; t++)
                {
                    if (n % 2 == 0)
                    {
                        j++;
                        Console.WriteLine(i + " " + j);
                        j++;
                        Console.WriteLine(i + " " + j);
                        j++;
                        Console.WriteLine(i + " " + j);
                        n++;
                    }
                    else
                    {
                        i++;
                        Console.WriteLine(i + " " + j);
                        i++;
                        Console.WriteLine(i + " " + j);
                        i++;
                        Console.WriteLine(i + " " + j);
                        n++;
                    }
                }
                
            }
        }
    }
}