def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))

def trans_li_int_sp():
    return list(map(list, (zip(*[li_int_sp() for _ in range(N)]))))



import pdb
import math


ABC = li_int_sp()
gcds = math.gcd(math.gcd(ABC[0],ABC[1]), ABC[2])

pdb.set_trace()
output = 0
for i in ABC:
    output += i//gcds-1
print(output)


979ca3e3115370af0a0e04baf5a66c108af174c2
def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))


def trans_li_int_sp():
    return list(map(list, zip(*[li_int_sp() for _ in range(N)])))


<mask token>

def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))


def trans_li_int_sp():
    return list(map(list, zip(*[li_int_sp() for _ in range(N)])))


<mask token>
pdb.set_trace()
<mask token>
for i in ABC:
    output += i // gcds - 1
print(output)

def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))


def trans_li_int_sp():
    return list(map(list, zip(*[li_int_sp() for _ in range(N)])))


<mask token>
ABC = li_int_sp()
gcds = math.gcd(math.gcd(ABC[0], ABC[1]), ABC[2])
pdb.set_trace()
output = 0
for i in ABC:
    output += i // gcds - 1
print(output)

def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))


def trans_li_int_sp():
    return list(map(list, zip(*[li_int_sp() for _ in range(N)])))


import pdb
import math
ABC = li_int_sp()
gcds = math.gcd(math.gcd(ABC[0], ABC[1]), ABC[2])
pdb.set_trace()
output = 0
for i in ABC:
    output += i // gcds - 1
print(output)

def int_sp():
    return map(int, input().split())


def li_int_sp():
    return list(map(int, input().split()))

def trans_li_int_sp():
    return list(map(list, (zip(*[li_int_sp() for _ in range(N)]))))



import pdb
import math


ABC = li_int_sp()
gcds = math.gcd(math.gcd(ABC[0],ABC[1]), ABC[2])

pdb.set_trace()
output = 0
for i in ABC:
    output += i//gcds-1
print(output)

