#include <bits/stdc++.h>
using namespace std;
int n, m, pp = 10000000;
long long ans;
bool hash[10000008];
struct Tprogram {
  void open() {}
  void close() {}
  void init() { scanf("%d%d", &n, &m); }
  void work() {
    ans = 0;
    for (int i = 1; i <= n; i++) {
      if (i * i > m) {
        ans += (long long)m * 2 * (n - i + 1);
        break;
      }
      ans += i * i * 2;
    }
    for (int x = 1; x <= n; x++) {
      int y = (2 * n - x < m / x ? 2 * n - x : m / x);
      if (y < x) break;
      ans -= ((y - x) / 2 + 1) * 2;
    }
    int even_num = (m / 4 + 1 < n ? m / 4 + 1 : n),
        odd_num = ((m + 1) / 2 < n ? (m + 1) / 2 : n);
    ans += even_num + odd_num - 1;
    printf("%I64d\n", ans);
  }
} Program;
int main() {
  Program.init();
  Program.work();
  return 0;
}
