Imagine you have an infinite 2D plane with Cartesian coordinate system. Some of the integral points are blocked, and others are not. Two integral points A and B on the plane are 4-connected if and only if:

  * the Euclidean distance between A and B is one unit and neither A nor B is blocked; 
  * or there is some integral point C, such that A is 4-connected with C, and C is 4-connected with B. 



Let's assume that the plane doesn't contain blocked points. Consider all the integral points of the plane whose Euclidean distance from the origin is no more than n, we'll name these points special. Chubby Yang wants to get the following property: no special point is 4-connected to some non-special point. To get the property she can pick some integral points of the plane and make them blocked. What is the minimum number of points she needs to pick?

Input

The first line contains an integer n (0 ≤ n ≤ 4·107).

Output

Print a single integer — the minimum number of points that should be blocked.

Examples

Input

1


Output

4


Input

2


Output

8


Input

3


Output

16
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.TreeSet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.datatransfer.ClipboardOwner;

public class Solution 
{
    public static void main(String[] args) {
        new Solution().solve();     
    }
    PrintWriter out;
    long mod=1000000007L ;
    int sqrt;
    public void solve()
    {
        out=new PrintWriter(System.out);
        int n=in.nextInt();
        if(n==0)
        {
            System.out.println(1);
            return;
        }
        if(n==1)
        {
            System.out.println(4);
            return;
        }
        long ans=0L;
        long nn=(long)n*n;
        int lastx=n;
        for(int y=1;y<=n;y++)
        {
            int curx=lastx;
            while(curx*(long)curx+y*(long)y>nn)
            {
                curx--;
            }
            //System.out.println(curx);
            ans+=lastx-curx;
            if(lastx==curx)
                ans++;
            lastx=curx;
        }
        
        System.out.println(ans*4L);
        out.close();
    }

    class qq implements Comparable<qq>
    {
        int l;
        int r;
        int idx;
        public qq(int idx,int l,int r)
        {
            this.idx=idx;
            this.l=l;
            this.r=r;
        }
        public String toString()
        {
            return " {" + this.idx+" "+this.l+" "+this.r+" } ";
        }
        @Override
        public int compareTo(qq o) {
            // TODO Auto-generated method stub
            
            if(this.l/sqrt==o.l/sqrt)
            {
                return Integer.compare(this.r, o.r);
            }
            else
            {
                return Integer.compare(this.l, o.l);
            }
        }
    }
    
    class ss
    {
        int val;
        int freq;
        public ss(int val,int freq)
        {
            this.val=val;
            this.freq=freq;
        }
    }
    
    class s implements Comparable<s>
    {
        int val;
        int idx;
        public s(int v,int i)
        {
            this.val=v;
            this.idx=i;
        }
        @Override
        public int compareTo(s o) {
            // TODO Auto-generated method stub
            if(o.val==this.val)
            {
                return Integer.compare(this.idx, o.idx);
            }
            else
            {
                return Integer.compare(this.val, o.val);
            }

        }

    }




    public class UF {

        private int[] parent;  // parent[i] = parent of i
        private byte[] rank;   // rank[i] = rank of subtree rooted at i (never more than 31)
        private int count;   
        int[] seg;
        int max;
        // number of components
        public UF(int N) {
            if (N < 0) throw new IllegalArgumentException();
            count = N;
            parent = new int[N];
            rank = new byte[N];
            seg=new int[N];
            for (int i = 0; i < N; i++) {
                parent[i] = i;
                rank[i] = 0;
                seg[i]=1;
            }
            max=1;
        }

        public int find(int p) {
            if (p < 0 || p >= parent.length) throw new IndexOutOfBoundsException();
            while (p != parent[p]) {
                parent[p] = parent[parent[p]];    // path compression by halving
                p = parent[p];
            }
            return p;
        }
        public int count() {
            return count;
        }

        public boolean connected(int p, int q) {
            return find(p) == find(q);
        }

        public boolean union(int p, int q) {
        //  System.out.println("uf "+p+" "+q);
            int rootP = find(p);
            int rootQ = find(q);
            if (rootP == rootQ) return false;

            // make root of smaller rank point to root of larger rank
            if      (rank[rootP] < rank[rootQ])
            {
                parent[rootP] = rootQ;
                seg[rootQ]+=seg[rootP];
                max=Math.max(seg[rootQ],max);
            }
            else if (rank[rootP] > rank[rootQ])
            {
                parent[rootQ] = rootP;
                seg[rootP]+=seg[rootQ];
                max=Math.max(seg[rootP],max);
            }
            else {
                parent[rootQ] = rootP;
                rank[rootP]++;
                seg[rootP]+=seg[rootQ];
                max=Math.max(seg[rootP],max);
            }
            count--;
            return true;
        }

    }












    //  long pow(long a,int n,long m)
    //  {
    //      if(n==1)
    //          return a;
    //      if(n==0)
    //          return 1;
    //      long ans=pow(a,n/2,m);
    //      ans*=ans;
    //      ans%=m;
    //      if(n%2!=0)
    //          ans*=a;
    //      ans%=m;
    //      return ans;
    //  }

    class segTree
    {
        int N =(int) 1e5; // limit for array size
        int n;  // array size
        int[] max=new int[2*(int)1e5];
        int[] count=new int[2*(int)1e5];

        public segTree(int[] arr)
        {
            n=arr.length;
            for(int i=0;i<arr.length;i++)
            {
                max[i+n]=arr[i];
                count[i+n]=1;
            }
            build();
            //          for(int i=0;i<2*arr.length;i++)
            //          {
            //              System.out.print(max[i]+" ");
            //          }
            //          System.out.println();
            //          for(int i=0;i<2*arr.length;i++)
            //          {
            //              System.out.print(count[i]+" ");
            //          }
            //  System.out.println(Arrays.toString(max)+" "+Arrays.toString(count));
        }
        void build() {  // build the tree
            for (int i = n - 1; i > 0; --i)
            {
                if(max[i<<1]!=max[i<<1|1])
                {
                    max[i] = Math.max(max[i<<1] , max[i<<1|1]);
                    if(max[i]==max[i<<1])
                    {
                        count[i]=count[i<<1];
                    }
                    else
                    {
                        count[i]=count[i<<1|1];
                    }
                }
                else
                {
                    max[i]=max[i<<1];
                    count[i]=count[i<<1]+count[i<<1|1];
                }
            }
        }

        //      void modify(int p, int value) {  // set value at position p
        //        for (max[p += n] = value; p > 1; p >>= 1) max[p>>1] = max[p] + max[p^1];
        //      }

        int query(int l, int r) {  // sum on interval [l, r)
            int res = 0;
            int max1=0;
            for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
                if ((l&1)!=0)
                {

                    if(max1 == max[(l)])
                    {
                        res+=count[l];
                    }
                    else if(max1<max[l])
                    {
                        res=count[l];
                        max1=max[l];
                    }
                    l++;
                }
                if ((r&1)!=0)
                {
                    --r;
                    if(max1 == max[r])
                    {
                        res+=count[r];
                    }
                    else if(max1<max[r])
                    {
                        res=count[r];
                        max1=max[r];
                    }
                }
            }
            return res;
        }
    }

    public static int gcd(long a, long b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }



    FasterScanner in=new FasterScanner();

    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
} 
