from math import lcm n, a, b = map(int, input().split()) print(n - n // a - n // b + n // lcm(a, b))