#include<bits/stdc++.h>
using namespace std;
int main(){
int a, b, L, counter=0;
cin>>a>>b>>L;
for(int k=1; k<=L; k++){
int x=1, y=1;
if(x*a+y*b!=k){
    counter++;
}
x++;
y++;
}
cout<<counter;

return 0;
}
