from math import gcd t, a, b = map(int, input().split()) lcm = a * b // gcd(a, b) na = (t + a - 1) // a nb = (t + b - 1) // b nlcm = (t + lcm - 1) // lcm print(na + nb - nlcm)