#include #include #include using namespace std; #define REP(i,n) for(int i = 0; i < (n); ++i) #define P(x) cout << (x) << "\n" #define D(x) cerr << (x) << "\n" #define fcout cout << fixed << setprecision(18) using i64=long long int; // 10^18 int main(){ ios::sync_with_stdio(false); cin.tie(0); i64 a,b,c;cin>>a>>b>>c; i64 n = c/(a+b-1); i64 m = (c-n*(a+b-1)) - (a-1); i64 ans = n*a + (m>0 ? a : m + a-1); P(ans); return 0; }