x = input() if "." in x: a, b = x.split(".") bunshi = 0 bunbo = 0 bunshi = int(a) * pow(10, len(b)) + int(b) bunbo = pow(10, len(b)) else: print(x + "/1") exit() # 素因数分解 def prime_factor(n): # (素因数, 数)のリストで出てくる d = {} for i in range(2, int(n ** 0.5) + 1): while n % i == 0: if i in d: d[i] += 1 else: d[i] = 1 n //= i if n != 1: if n in d: d[n] += 1 else: d[n] = 1 return d a = prime_factor(bunbo) b = prime_factor(bunshi) for key in a.keys(): if key in b: n1 = b[key] n2 = a[key] if n1 > n2: bunshi //= pow(key, n2) bunbo //= pow(key, n2) else: bunbo //= pow(key, n1) bunshi //= pow(key, n1) print(f"{bunshi}/{bunbo}")