#include <fstream>

using namespace std;

int main()
{
	ifstream input("CAU1_15.inp");
	ofstream output("CAU1_15.out");

	long long count = 0;
	long long a, b, c;
	input >> a >> b >> c;
	long double temp = (long double)c / (long double)b;
	for (long long int i = 1; i < temp; i++)
	{
		if ((c - b * i) % a == 0)
		{
			count++;
		}
	}
	output << count;
	input.close();
	output.close();
	return 0;
}