#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define ld long double #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N, K; cin >> N >> K; ll MAX = (1 + N) * N / 2, MIN = (1 + N - K) * (N - K) / 2 - (N - K + 1 + N) * K / 2; cout << (MAX - MIN) / 2 + 1 << endl; return 0; }