#include<iostream>
using namespace std;
int main ()
{
    long long a, b, L, br=0, x=1, y=1, x1, y1;
    cin >> a >> b >> L;
    if (a>b)
        swap (a, b);
    while (x*a+y*b<=L)
    {
        if (x*a+y*b<=L)
            br++;
        x++;
        if (x*a+y*b<=L)
            br++;
        y++;
        x--;
        if (x*a+y*b<=L)
            br++;
        x++;
        if (x*a+y*b<=L)
            br++;
    }
    cout << L-br << endl;
    return 0;
}