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:
import java.io.*;

import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {

	final String filename = "";

	public void solve() throws Exception {
//		cycle: for (int i = 1; i < 100; i++)
//			for (int j = 1; j < 100; j++) {
//				long ans1 = count(i, j);
//				long ans2 = dummy(i, j);
//				if (ans1 != ans2) {
//					System.out.println("FAIL n=" + i + " m=" + j + " ans1="
//							+ ans1 + " ans2=" + ans2 + " integers=" + integers
//							+ " integers2=" + integers2);
//					break cycle;
//				}
//			}
//		System.out.println("OK");
		int n = iread(), m = iread();
		out.write(count(n, m) + "\n");
	}

	long integers;

	long count(int n, int m) {
		long max = -1;
		long min = 0;

		long ans = 0;
		long c1 = 0;
		integers = 0;
		for (long b = 1; b <= n; b++) {
			long b1 = Math.max(b * b - m, 0);
			while (c1 * c1 < b1)
				c1++;
			if (c1 + 1 < b || c1 == 0)
				min = Math.min(min, -2 * b + 1);
			else if (b1 > 0 && c1 == b - 1 && -2 * b + 1 < min)
				integers++;
			ans += 2 * ((b * b - b1) - (b - c1));
		}
		integers += (max - min + 1);
		ans += integers;
		return ans;
	}

	int integers2;

	long dummy(int n, int m) {
		double[] res = new double[2 * n * m];
		int k = 0;
		for (int b = 1; b <= n; b++)
			for (int c = 1; c <= m; c++)
				if (b * b >= c) {
					double x1 = -b + Math.sqrt(b * b - c);
					double x2 = -b - Math.sqrt(b * b - c);
					res[k++] = x1;
					res[k++] = x2;
				}
		Arrays.sort(res, 0, k);
		int ans = 0;
		integers2 = 0;
		// System.out.println("=");
		for (int i = 0; i < k; i++) {
			if (i == k - 1 || res[i] < res[i + 1] - (1e-7)) {
				ans++;
				if (Math.abs(Math.round(res[i]) - res[i]) < 1e-7) {
					// System.out.println(res[i]);
					integers2++;
				}
			}
		}
		return ans;
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			// in = new BufferedReader(new FileReader(filename+".in"));
			// out = new BufferedWriter(new FileWriter(filename+".out"));
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int iread() throws Exception {
		return Integer.parseInt(readword());
	}

	public double dread() throws Exception {
		return Double.parseDouble(readword());
	}

	public long lread() throws Exception {
		return Long.parseLong(readword());
	}

	BufferedReader in;

	BufferedWriter out;

	public String readword() throws IOException {
		StringBuilder b = new StringBuilder();
		int c;
		c = in.read();
		while (c >= 0 && c <= ' ')
			c = in.read();
		if (c < 0)
			return "";
		while (c > ' ') {
			b.append((char) c);
			c = in.read();
		}
		return b.toString();
	}

	public static void main(String[] args) {
		try {
			Locale.setDefault(Locale.US);
		} catch (Exception e) {

		}
		new Thread(new Main()).start();
		// new Thread(null, new Main(), "1", 1<<25).start();
	}
}