T,A,B = list(map(int, input().split())) def gcd(a, b): if b == 0: return a else: return gcd(b, a%b) def lcm(a, b): return a * b // gcd(a,b) print((T+A-1) // A + (T+B-1) // B - (T+lcm(A,B)-1) // lcm(A,B))