#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll a, ll b){return a * b / gcd(a, b);} int main(){ ll a,b,k; cin>>a>>b>>k; ll n=lcm(a,b); map x; for(int i=1;i<=n;i++){ if(a<=n/i)x[a*i]; else break; } for(int i=1;i<=n;i++){ if(b<=n/i)x[b*i]; else break; } x[n]++; //cout<