from math import gcd def lcm(x, y): return (x*y)//gcd(x, y) T, A, B = map(int, input().split()) ta = -(-T//A) tb = -(-T//B) tab = -(-T//lcm(A, B)) #print("ta",ta) #print("tb",tb) #print("tab",tab) print(ta+tb-tab)