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