#include<bits/stdc++.h>
using namespace std;
int main()
{
    freopen("bai2_17.inp","r",stdin);
    freopen("bai2_17.out","w",stdout);
    int64_t k,m,n;
    cin>>k>>m>>n;
    int64_t s=n/k;
    int64_t x=n/m;
    int64_t r=n/(k*m);
    cout<<s+x-r;
}
