#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>
 
using namespace std;

typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)

#define MOD 1000000007

long long gcd(long long a, long long b){
  return b == 0LL ? a : gcd(b, a % b);
}
long long lcm(long long a, long long b){
  return a / gcd(a, b) * b;
}

int main(){
  ll a,b,k;
  cin>>a>>b>>k;
  long long low = 0;
  long long high = 1000000000000000000LL;
  ll g = lcm(a,b);
  while(low < high){
    long long mid = (high + low) >> 1; 
    ll c = mid/a+mid/b-mid/g;
    if(c >= k){
      high = mid;
    }
    else{
      low = mid + 1;
    }
  }
  cout << low << endl;
  return 0;
}