#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) using namespace std; using LL = long long; using P = pair; const LL INF = 5e18; int main(){ LL A, B, K; cin >> A >> B >> K; LL left = 1, right = INF; while(right - left > 1){ LL mid = (left + right) / 2; LL res = mid / A + mid / B - mid / (A * B); if(res >= K) right = mid; else left = mid; } cout << right << endl; return 0; }