Problem: A schoolboy Petya studies square equations. The equations that are included in the school curriculum, usually look simple: 

x2 + 2bx + c = 0 where b, c are natural numbers.

Petya noticed that some equations have two real roots, some of them have only one root and some equations don't have real roots at all. Moreover it turned out that several different square equations can have a common root.

Petya is interested in how many different real roots have all the equations of the type described above for all the possible pairs of numbers b and c such that 1 ≤ b ≤ n, 1 ≤ c ≤ m. Help Petya find that number.

Input

The single line contains two integers n and m. (1 ≤ n, m ≤ 5000000).

Output

Print a single number which is the number of real roots of the described set of equations.

Examples

Input

3 3


Output

12


Input

1 2


Output

1

Note

In the second test from the statement the following equations are analysed:

b = 1, c = 1: x2 + 2x + 1 = 0; The root is x = - 1

b = 1, c = 2: x2 + 2x + 2 = 0; No roots

Overall there's one root

In the second test the following equations are analysed:

b = 1, c = 1: x2 + 2x + 1 = 0; The root is x = - 1

b = 1, c = 2: x2 + 2x + 2 = 0; No roots

b = 1, c = 3: x2 + 2x + 3 = 0; No roots

b = 2, c = 1: x2 + 4x + 1 = 0; The roots are <image>

b = 2, c = 2: x2 + 4x + 2 = 0; The roots are <image>

b = 2, c = 3: x2 + 4x + 3 = 0; The roots are x1 = - 3, x2 = - 1

b = 3, c = 1: x2 + 6x + 1 = 0; The roots are <image>

b = 3, c = 2: x2 + 6x + 2 = 0; The roots are <image>

b = 3, c = 3: x2 + 6x + 3 = 0; The roots are <image> Overall there are 13 roots and as the root  - 1 is repeated twice, that means there are 12 different roots.

Solution (in JAVA):

Solution:
//package E;

import java.util.*;
import java.io.*;



public class solver {

	public static long ceil(long a){
		long t=(long)Math.sqrt(a);
		if(t*t==a) return t;
		else return t+1;
	}
	public static void getcomplexity(){
		double n=5000000.0;
		double ret=0;
		for(double i=1.0;i<n;i++)
			ret+=n/i;
		System.out.print(ret);
	}
	public static long count_all_integer_roots(long n,long m){
		long cnt=0;
		for(int i=1;i<=2*n;i++)
		{
			if(i+1<=2*n && i<=m && (i+1)%2==0) {cnt++; }
			else if(i+2<=2*n && 2*i<=m && i%2==0) {cnt++; }
		}
	return cnt;	
	}
	public static void show_integer_intervals(long n,long m){
	for(long b=1;b<=n;b++)
		{
		if(b*b-m<0) continue;
		long left1=1;
		long rigth=b-ceil(b*b-m);
		long left2=b+ceil(b*b-m);
		long rigth2=2*b-1;
		System.out.println(b+": ["+left1+", "+rigth+"] ["+left2+","+rigth2+"]");
		}
	}
	public static long count_all_non_integer_roots(long n,long m){
		long ret=0;
		long all=0;
		for(long i=1;i<=n;i++)
			{
			if(i*i>m)	ret+=(long) Math.sqrt(i*i-1)-(long)Math.sqrt(i*i-m-1);
			else ret+=i;
			all+=Math.min(i*i,m);
			//System.out.println(i+" "+ret+" "+all);
			
			}
		return 2*(all-ret);
	}
	public static void main(String[] args) throws Exception {
	Scanner in=new Scanner(System.in);
	//Scanner in=new Scanner(new File("input.txt"));
		long n,m;
		n=in.nextLong();
		m=in.nextLong();
	long ret=0;
	
	/*long up=(long)Math.sqrt(m);
	up=Math.min(n,up);
	
	long f=up*(up+1)*(2*up+1)/6;
	long s=0;
	if(n>up) 
	s=(n-up)*m;
	/*ret=2*(f+s);
	ret-=up;
	
	long ret2=0;
	for(long b=0;b<=m;b++)
	{
		if(b*b>=m) ret2+=b-ceil(b*b-m);
		if(b*b>=m) ret2+=b-(long)Math.sqrt(b*b-m);
	}
	ret2/=2;
	long sub=up*(up+1)/2;
	sub+=up; sub*=2; sub-=up;
	*/
	//System.out.println(s);
	//System.out.println(sub);
	//show_integer_intervals(n,m);
	//getcomplexity();
	System.out.println(count_all_non_integer_roots(n, m)+count_all_integer_roots(n, m));
	//System.out.println(count_all_integer_roots(n, m));
	in.close();
	}

}