#include <iostream>
using namespace std;

int main () {
int n,d,k,broqch=0,staro_d;
cin >> n >> d >> k;
staro_d = d;
if (d+k-n>0)
{
while (d<=staro_d*k)
{
broqch=broqch+d;
d=d+d;
}
broqch = (broqch + d) - ((staro_d*2)*n);
cout << broqch << endl;
}
else
{
while (d<=staro_d*k)
{
broqch=broqch+d;
d=d+d;
}
cout << broqch << endl;
}
return 0;
}