def gcd(a,b): if b == 0: return a else: return gcd(b, a % b) def lcm(a,b): if a*b == 0: return 0 else: return a // gcd(a,b) * b t,a,b = map(int,input().split()) c = lcm(a,b) sum = 0 sum += t//a+(1 if t%a!=0 else 0) sum += t//b+(1 if t%b!=0 else 0) sum -= t//c+(1 if t%c!=0 else 0) print(sum)