import math def lcm(x, y): return (x * y) // math.gcd(x, y) t, a, b = map(int, input().split()) t -= 1 c = 1 c += t // a c += t // b c -= t // lcm(a, b) print(c)