def gcd(a,b): if b == 0: return a else: return gcd(b, a % b) def lcm(a,b): if a*b == 0: return 0 else: return a // gcd(a,b) * b a,b,t = map(int,input().split()) print(t//a+t//b-t//lcm(a,b))