#include using namespace std; using lint = long long; template using V = vector; template using VV = V< V >; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); lint h, w; cin >> h >> w; w = abs(w); if (!h or !w) return cout << 0 << '\n', 0; lint q = w / h, r = w - q * h; lint res = q * (h * (h + 1) / 2) + (r ? h + r * (r - 1) / 2 : 0); cout << res << '\n'; }