#include <bits/stdc++.h>
using namespace std;

int statsNumbers[100001];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int numberOne, numberTwo;
    int maxNumber;
    cin >> numberOne >> numberTwo >> maxNumber;

    for(int oneTest=1; oneTest<=maxNumber/numberOne; oneTest++)
    {
        if(oneTest*numberOne+1*numberTwo>maxNumber)
        {
            break;
        }

        for(int twoTest=1; twoTest<=(maxNumber-oneTest*numberOne)/numberTwo; twoTest++)
        {
            if(oneTest*numberOne+twoTest*numberTwo>maxNumber)
            {
                break;
            }

            statsNumbers[oneTest*numberOne+twoTest*numberTwo]++;
        }
    }

    int counter=0;

    for(int number=1; number<=maxNumber; number++)
    {
        if(statsNumbers[number]==0)
        {
           counter++;
        }
    }

    cout << counter;
    return 0;
}
