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.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Hashtable;
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.TreeSet;

public class Q1 {

	static long k;
	static int[] a;
	static int MAX_N=(int)2e5+1;
	static int[] count;
	static int[] ans;
	public static void main(String[] args)
	{
    	FasterScanner s=new FasterScanner();
    	PrintWriter out=new PrintWriter(System.out);
    	
    	long n=s.nextLong();
    	
//    	for(int i=0;i<=n;i++)
//    	{
//    		System.out.print(i+" ---");
//    		for(int j=0;j<=(int) Math.sqrt(n*n-i*i);j++)
//    		{
//    			System.out.print(j+" ");
//    		}
//    		System.out.println();
//    	}
    	long ans=1;
    	
    	long x=0;
    	long prev=n;
    	for(x=1;x<=n;x++)
    	{
    		long y=(int) Math.sqrt(n*n-x*x);
    		ans+=(Math.abs(prev-y))>0?Math.abs(prev-y):1;
    		prev=y;
    	}
    	ans--;
    	if(n!=0)
    	System.out.println(ans*4);
    	else
    		System.out.println(1);
    	out.close();
	}
	static void add(int p)
	{
		
		count[a[p]]++;
		ans[count[a[p]]]++;
	}
	static void remove(int p)
	{
		ans[count[a[p]]]--;
		count[a[p]]--;
	}
	static long[] t=new long[2*MAX_N];

	static int n=MAX_N;
	static void build() {  // build the tree
		
		for (int i = n - 1; i > 0; --i)
			t[i]=Math.max(t[i<<1],t[i<<1|1]);
	}

	static void update(int p, int value) {  // set value at position p
		if(p<0)
			return;
	  for (t[p += n] += value; p > 1; p >>= 1) t[p>>1] =t[p] + t[p^1];
	}

	static long query(int l, int r) {  // sum on interval [l, r)
	  long res=0;
			  
	  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
		    if ((l&1)!=0) res+=t[l++];
		    if ((r&1)!=0) res+=t[--r];
		  }
	  return res;
	}
	static class Query implements Comparable<Query>
	{
		static int BLOCK=(int) Math.sqrt(MAX_N)+1;
		int ind;
		int l;
		int r;
		long ans=0;
		Query(int i,int l1,int r1)
		{
			ind=i;
			l=l1;r=r1;
		}
		@Override
		public int compareTo(Query o) {
			if(l/BLOCK!=o.l/BLOCK)
				return l/BLOCK-o.l/BLOCK;
			return r-o.r;
		}
	}
	
	
	
	
	
	
	public static class UF {
		public int max=1;
		private int[] size;
	    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;     // number of components
	    public UF(int N) {
	        if (N < 0) throw new IllegalArgumentException();
	        count = N;
	        parent = new int[N];
	        rank = new byte[N];
	        size = new int[N];
	        for (int i = 0; i < N; i++) {
	            parent[i] = i;
	            rank[i] = 0;
	            size[i]=1;
	        }
	    }
	    public void print(int id)
	    {
	    	for(int i=0;i<parent.length;i++)
	    		if(parent[i]==parent[id])
	    			System.out.print(i+" ");
	    	System.out.println();
	    }
	    public int find(int p) {
	        if (p < 0 || p >= parent.length) return -1;
	        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) {
	    	if(p>=rank.length || q>=rank.length)
	    		return false;
	    	
	        return find(p) == find(q);
	    }

	    public boolean union(int p, int q) {
	    	
	    	if(p>=rank.length || q>=rank.length)
	    		return false;
	        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;
	        	size[rootQ]+=size[rootP];
	        	if(size[rootQ]>max)
	        		max=size[rootQ];
	        }
	        else if (rank[rootP] > rank[rootQ]){
	        	parent[rootQ] = rootP;
	        	size[rootP]+=size[rootQ];
	        	if(size[rootP]>max)
	        		max=size[rootP];
	        }
	        else {
	            parent[rootQ] = rootP;
	            rank[rootP]++;
	        	size[rootP]+=size[rootQ];
	        	if(size[rootP]>max)
	        		max=size[rootP];
	        }
	        count--;
	        return true;
	    }

	}
	
	static long mod=(long) (1e9+7);
	static long pow(long a,long p)
	{
		if(p==0)
			return 1;
		if(p==1)
			return a;
		long ans=1;
		ans=pow(a,p/2);
		ans*=ans;
		ans%=mod;
		if(p%2!=0)
			ans*=a;
		ans%=mod;
		return ans;
	}
	

//	static void go(int ind)
//	{
//		int count=0;
//		done[ind]=true;
//		for(int i=0;i<n;i++)
//		{
//			if(edge[ind][i])
//				count++;
//		}
//		if(count>2)
//		{
//			System.out.println("NO");
//			System.exit(0);
//		}
//		if(count==2)
//		{
//			int left=0;
//			int right=0;
//			for(int i=0;i<n;i++)
//			{
//				if(edge[ind][i])
//				{
//					left=i;
//				}
//			}
//			for(int i=left+1;i<n;i++)
//			{
//				if(edge[ind][i])
//				{
//					right=i;
//				}
//			}
//			done[left]=true;
//			done[right]=true;
//			
//			
//			
//			
//		}
//	}
//	
//	
//    static void dfs(int ind)
//    {
//    	started[ind]=true;
//    	for(int i=0;i<n;i++)
//    	{
//    		if(edge[ind][i])
//    		{
//    			if(done[i])
//    			{
//    				System.out.println("NO");
//    				System.exit(0);
//    			}
//    			if(!started[i])
//    				dfs(i);
//    		}
//    	}
//    	done[ind]=true;
//    }

	public static class Pair implements Comparable<Pair> 
	{
		int d=Integer.MAX_VALUE;
		int x;
		int y;
		int w;
		public Pair(int x,int y,boolean w)
		{
			this.x=x;
			this.y=y;
			if(w)
			this.w=1;
			else
				this.w=0;
			
		}
		@Override
		public int compareTo(Pair o) {
			if(d!=o.d)
				return d-o.d;
			if(x!=o.x)
				return (int) (x-o.x);
			return (int) (y-o.y);
		}
	}
	

	
	
	
	
	
	
	
	
	
	
























    
    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;
        }
    }
}