using System;

class Program
{
    static void Main(string[] args)
    {
        var inp = Console.ReadLine().Split(' ');
        int max = int.Parse(inp[0]) + 1;
        int count = int.Parse(inp[1]);
        int ans = 0;

        for (int idx = count; idx < max + 1; idx++)
        {
            int a = (max - 1) * (max - idx);
            if (a > 0)
            {
                ans += a;
            }
            else
            {
                ans++;
            }
        }

         Console.WriteLine(ans.ToString());
        
    }
}