def gcd(a, b): if a < b: a, b = b, a while b >= 1: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) t, a, b = [int(v) for v in input().split()] c = lcm(a, b) print( (t+a-1)//a + (t+b-1)//b - (t+c-1)//c)