from fractions import Fraction V, T = input().split() m = Fraction(V) * Fraction(T) ans = m.numerator // m.denominator print(ans)