#include int main() { int h, w, step = 1; long ans = 0; std::cin >> h >> w; if (w < 0) { w = -w; } else if (w == 0) { std::cout << 0 << std::endl; return 0; } for (int i = 1; i <= h; i++) { if (step >= 2 * i) step = 2 * i; if (w <= i) { ans++; } else { ans += (w - i - 1) / step + 2; } } std::cout << ans << std::endl; }