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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int nextInt() {
  int x;
  scanf("%d", &x);
  return x;
}
string nextString() {
  char s[20];
  scanf("%s", &s);
  return s;
}
long long numbersCount(long long a, long long b) {
  if (a > b) {
    return 0;
  }
  return b - a + 1;
}
long long squaresCount(long long a) {
  if (a < 0) {
    return 0;
  }
  if (a == 0) {
    return 1;
  }
  return sqrt((double)a) + 1e-9 + 1;
}
long long squaresCount(long long a, long long b) {
  if (a > b) {
    return 0;
  }
  return squaresCount(b) - squaresCount(a - 1);
}
long long sqr(long long a) { return a * a; }
long long solve(long long n, long long m) {
  long long minInt = INT_MAX;
  long long maxInt = -INT_MAX;
  long long irrCount = 0;
  vector<pair<int, int> > v;
  for (long long b = 1; b <= n; ++b) {
    if (sqr(b - 1) >= sqr(b) - m) {
      {
        long long from = -b - (b - 1);
        long long to =
            m >= b * b ? -b : -b - ceil(sqrt((double)b * b - m) - 1e-9);
        if (from <= to) v.push_back(make_pair(from, to));
      }
      {
        long long from =
            m >= b * b ? -b : -b + floor(sqrt((double)b * b - m) + 1e-9);
        long long to = -b + (b - 1);
        if (from <= to) v.push_back(make_pair(from, to));
      }
    }
    long long from = max(0LL, b * b - m);
    long long to = b * b - 1;
    long long A = numbersCount(from, to);
    long long B = squaresCount(from, to);
    irrCount += 2 * (A - B);
  }
  long long res = irrCount;
  sort(v.begin(), v.end());
  int hi = INT_MIN;
  int lo = INT_MIN + 1;
  for (int i = 0; i < v.size(); ++i) {
    if (v[i].first > hi) {
      res += hi - lo + 1;
      lo = v[i].first;
    }
    hi = max(hi, v[i].second);
  }
  res += hi - lo + 1;
  return res;
}
int cmp(double x) {
  double eps = 1e-9;
  return x < -eps ? -1 : x > eps ? 1 : 0;
}
bool solve2(double a, double b, double c, double &x1, double &x2) {
  if (cmp(a) == 0) {
    if (cmp(b) == 0) {
      if (cmp(c) == 0) {
        x1 = x2 = 0;
        return true;
      } else {
        return false;
      }
    } else {
      x1 = x2 = -c / b;
      return true;
    }
  } else {
    double d = b * b - 4 * a * c;
    if (cmp(d) < 0) {
      return false;
    }
    d = cmp(d) == 0 ? 0 : sqrt(d);
    x1 = (-b + d) / (2 * a);
    x2 = (-b - d) / (2 * a);
    return true;
  }
}
int brute(int n, int m, vector<double> &roots) {
  roots.clear();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      double x1, x2;
      if (solve2(1, 2 * i, j, x1, x2)) {
        roots.push_back(x1);
        roots.push_back(x2);
      }
    }
  }
  sort(roots.begin(), roots.end());
  int res = 1;
  for (int i = 1; i < roots.size(); ++i) {
    if (roots[i] - roots[i - 1] > 1e-9) {
      ++res;
    }
  }
  return res;
}
int main() {
  long long n = nextInt();
  long long m = nextInt();
  long long res = solve(n, m);
  cout << res << endl;
  return 0;
}