#include <bits/stdc++.h>
using namespace std;
int uc(int a,int b)
{
	int r;
	while(b!=0)
	{
		r=a%b;
		a=b;
		b=r;
	}
	return a;
}
int bc(int a,int b)
{
	return a*b/uc(a,b);
}
int main()
{
	ifstream f1("BAI2_17.INP");
	ofstream f2("BAI2_17.OUT");
	int a,b,c;
	f1>>a>>b>>c;
	f2<<c/a+c/b-c/bc(a,b);
}
