#include<iostream>
using namespace std;
int arr[30000000];
int main ()
{
    long long a, b, L, br=0, x=1, y=1, p=0, k=0;
    cin >> a >> b >> L;
    for (y=1; y<=L; y++)
    {
        for (x=1; x<=L; x++)
        {
            arr[k]=x*a+y*b;
            //cout << arr[i] << ' ' << arr[i+1] << ' ' << arr[i+2] << ' ';
            if (arr[k]<=L)
                br++;
            k++;
        }
    }
    cout << L-br << endl;
    return 0;
}