#include <iostream>
using namespace std;
int main()
{
int n, k, s = 0;
cin >> n >> k;
for (int i = 0; i <= n; i++)
if (i % k == 0)
s += i;
}
cout << s;
#include <iostream>
using namespace std;
int main()
{
int n, k, s = 0;
cin >> n >> k;
for (int i = 0; i <= n; i++)
{
if (i % k == 0)
{
s += i;
}
}
cout << s;
}