#include <iostream>
using namespace std;
int main ()
{
    long long a, b, L;
    cin >> a >> b >> L;
    bool mas[10000];
    for (int i = 0; i < L; i++)
    {
        mas[i] = true;
    }
    int x= 1, y= 1;
    while (x*a + b <= L)
    {
        y = 1;
        while (x*a + y*b <= L)
        {
            int rez = x*a + y*b;
            mas[rez-1] = false;
            y++;
        }
        x++;
    }
    int br = 0;
    for(int i = 0; i < L; i++)
    {
        if (mas[i] == true)
        {
            br++;
        }

    }
    cout << br << endl;
    return 0;
}
