import math n, a, b = map(int, input().split()) A = n // a B = n // b AB = n // math.lcm(a, b) # print(n, A, B, AB) print(n - A - B + AB)