#include #include #include #include #include #include #include #include #include #include #include #include #include #pragma warning(disable:4996) typedef long long ll; #define MIN(a, b) ((a)>(b)? (b): (a)) #define MAX(a, b) ((a)<(b)? (b): (a)) #define LINF 9223300000000000000 #define INF 2140000000 const long long MOD = 1000000007; using namespace std; int main(int argc, char* argv[]) { ll a,b,c; scanf("%lld%lld%lld", &a, &b, &c); ll m=(a-1+b); ll d=c/m; c=c%m; ll ans=d*a+(c>a-1? a: c); printf("%lld\n", ans); return 0; }