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

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