#include #include #include using namespace std; int main() { int H, W; cin >> H >> W; W = abs(W); if (H == 0 || W == 0) { cout << 0 << endl; } else { int startline = max(W - H, 0) + 1; long long ans = abs(H - W) + 1; for (int i = 0; i <= W / 2; ++i) { int l = max(startline, 2 * i), r = min(W, 2 * i + 2); if (l < r) ans += 1LL * (r - l) * (i + 1); } cout << ans << endl; } return 0; }