#include<bits/stdc++.h>using namespace std;main(){int n,k,w;while(cin>>n>>k>>w){ int ans=n; while(n>=k) { ans+=n/k*w; n=n%k+n/k*w; } cout<<ans<<endl;}}