s = input() sep = s.split(' ') t = int(sep[0]) a = int(sep[1]) b = int(sep[2]) import math def lcm(x, y): return (x * y) // math.gcd(x, y) def f(t, a): if t%a==0: return t//a else: return t//a+1 l = lcm(a, b) ans = f(t,a) + f(t,b) - f(t,l) print(ans)