func main() var n: int :: cui@inputInt() var d: int :: cui@inputInt() var ans: int :: n / math@gcd(n, d) - 1 do cui@print("\{ans}\n") end func