#include <iostream>
using namespace std;


int main()
{
    int n,d,k,help;
    int sbor=0;
    cin>>n>>d>>k;
    if (k*d<=n)
    {
    for (int i=1;i<=n; i=i+1)
    {
      if (i%k==0)
      {
        sbor=sbor+i;
      }
    }
    }


    return 0;
}