#!/usr/bin/env python3
from fractions import Fraction
from collections import defaultdict
import math
def lcm(a, b):
    return a * b // math.gcd(a, b)
def qlcm(p, q):
    a = p.numerator * q.denominator
    b = p.denominator * q.numerator
    c = p.denominator * q.denominator
    return Fraction(lcm(a, b), c)
def dir(v, t):
    x = v * t % 2
    return x < 1
def pos(v, t):
    x = v * t % 2
    return min(x, 2 - x)
t1 = int(input())
t2 = int(input())
t3 = int(input())
v1 = Fraction(2, t1)
v2 = Fraction(2, t2)
v3 = Fraction(2, t3)
t12 = lcm(t1, t2)
t = Fraction(0)
x = pos(v1, t)
ans = float('inf')
while t == 0 or x != 0:
    # update t
    d1 = dir(v1, t)
    d2 = dir(v2, t)
    if d1 == d2 == True: # right
        l = 2 * (1 - x)
    elif d1 == d2 == False: # left
        l = 2 * x
    else:
        l = 2
    t += l / (v1 + v2)
    x = pos(v1, t)
    # check P3
    y = pos(v3, t)
    for is_right in range(2):
        if is_right == x < y:
            dy = x + 1 + y
        else:
            dy = abs(x - y)
        dt = dy / v3
        if dt == 0 or (t12 - t3) % dt == 0:
            if dt == 0:
                k = 0
            else:
                k = (t12 - t3) / dt
            # print(t + t12 * k,  t + dt + t3 * k, k)
            if t + t12 * k == t + dt + t3 * k:
                ans = min(ans, t + t12 * k)
print(ans)