Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinist.

Ilia-alpinist calls every n minutes, i.e. in minutes n, 2n, 3n and so on. Artists come to the comrade every m minutes, i.e. in minutes m, 2m, 3m and so on. The day is z minutes long, i.e. the day consists of minutes 1, 2, ..., z. How many artists should be killed so that there are no artists in the room when Ilia calls? Consider that a call and a talk with an artist take exactly one minute.


-----Input-----

The only string contains three integers — n, m and z (1 ≤ n, m, z ≤ 10^4).


-----Output-----

Print single integer — the minimum number of artists that should be killed so that there are no artists in the room when Ilia calls.


-----Examples-----
Input
1 1 10

Output
10

Input
1 2 5

Output
2

Input
2 3 9

Output
1



-----Note-----

Taymyr is a place in the north of Russia.

In the first test the artists come each minute, as well as the calls, so we need to kill all of them.

In the second test we need to kill artists which come on the second and the fourth minutes.

In the third test — only the artist which comes on the sixth minute.

Difficulty: interview

Starter code:

Solutions:
n, m, z = list(map(int, input().split()))
print(sum(1 for t in range(1, z + 1) if t % n == 0 and t % m == 0))


inp = input().split()
n = int(inp[0])
m = int(inp[1])
z = int(inp[2])

for q in range(1, m + 1):
    if not (n * q) % m:
        break

lcm = n * q
print(z // (n * q))


from fractions import gcd
a, b, c = map(int, input().split())
print(c // (a * b // gcd(a, b)))

from fractions import gcd
n,m,z=list(map(int,input().split()))
l=n*m/gcd(n,m)
print(int(z//l))


from fractions import gcd
def lcm(n,m):
    return (n*m)//gcd(n,m)
a,b,c = map(int,input().split())
print(c//lcm(a,b))

n, m, z = map(int, input().split())

gcd = lambda a, b: gcd(b, a % b) if b else a
mm = n * m // gcd(n, m)
print(z // mm)

import sys

fin = sys.stdin
fout = sys.stdout
ans = 0
n, m, z = list(map(int, fin.readline().split()))
for i in range(1, z + 1):
    if i % n == 0 and i % m == 0:
        ans += 1
fout.write(str(ans))


from sys import stdin, stdout


def gcd(a, b):
    if not b:
        return a
    else:
        return gcd(b, a % b)
    

a, b, time = map(int, stdin.readline().split())
stdout.write(str(time // (a * b // gcd(a, b))))

from fractions import gcd

a, b, c = list(map(int, input().split(' ')))

a = a * b // gcd(a, b)

print(c // a)



n, m, z = [int(el) for el in input().split()]

ans = 0
for i in range(1, z + 1):
	if i % n == i % m == 0:
		ans += 1

print(ans)

from fractions import gcd

m, n, z = list(map(int, input().split()))
k = m*n//gcd(m,n)
print(int(z/k))



import math
n,m,z = (int(x) for x in input().split())
print(z//(n*m//math.gcd(n,m)))


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


n, m, z = map(int, input().split())
print(z // ((n * m) // gcd(n, m)))

import math


def ria():
    return [int(i) for i in input().split()]


n, m, z = ria()

print(z//(n*m//math.gcd(n,m)))

n,m,z = map(int, input().split())
c = n
ans = 0
while c <= z:
    if c % m == 0:
        ans += 1
    c+=n
print(ans)

n, m, z = map(int, input().split())

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

def nok(a, b):
    return a // gcd(a, b) * b

print(z // nok(n, m))

n, m, z = list(map(int, input().split()))

print(len([i for i in range(1, z + 1) if i % n == 0 and i % m == 0]))



def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


a, b, c = list(map(int, input().split()))
print(c // ((a * b) // gcd(a, b)))


def lcm(x, y):
   """This function takes two
   integers and returns the L.C.M."""

   # choose the greater number
   if x > y:
       greater = x
   else:
       greater = y

   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1

   return lcm

n, m, z = [int(x) for x in input().strip().split()]
fpb = lcm(n, m)
print(z // fpb)


from fractions import gcd
n, m, z = list(map(int, input().split()))
print(z // ((n * m) // gcd(n, m)))


from fractions import gcd

from sys import stdin as fin
# fin = open("cfr395a.in", "r")

n, m, z = map(int, fin.readline().split())
# n = int(fin.readline())
print(z // (n * m // gcd(n, m)))

def euclide(a,b):
    if b == 0:
        return a
    else:
        return euclide(b,a%b)

def ppcm(a,b):
    return b*(a//euclide(a,b))

def f(n,m,z):
    return z // ppcm(n,m)

n,m,z = tuple(map(int,input().split()))
print(f(n,m,z))


n,m,z=list(map(int,input().split()))
ans=0
for i in range(1,z+1):
  if i%m==0 and i%n==0:
    ans+=1
print(ans)


n, m, z = list(map(int, str.split(input())))
print(len(set(range(n, z + 1, n)) & set(range(m, z + 1, m))))


def gcd(a, b):
    while b:
        a %= b
        a, b = b, a
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

def main():
    n, m, z = list(map(int, input().split()))
    q = lcm(n, m)
    print(z // q)

main()