#include <stdio.h>
int main() {
int N, K, W;
scanf("%d %d %d", &N, &K, &W);
int total = N;
int used = N;
while (used >= K) {
int exchange = used / K * W;
total += exchange;
used = exchange + used % K;
}
printf("%d\n", total);
return 0;
}