#include <iostream>
using namespace std;
int main(){
int n, k, w;
// There may be multiple test cases.
while(cin >> n >> k >> w){
int original = n; // Save the original count
int extraSum = 0;
// While we have enough phones for an exchange
while(n >= k){
int groups = n / k; // How many groups we can make
int newPhones = groups * w; // Extra phones we get in this round
extraSum += newPhones;
// Update: new available phones = new extra phones + remainder phones
n = newPhones + n % k;
}
// The total is the original phones plus all extra phones obtained.
cout << original + extraSum << "\n";
}
return 0;
}