import math def lcm(x, y): return (x * y) // math.gcd(x, y) T,A,B = map(int,input().split()) T -= 1 count = T//A + T//B l = lcm(A,B) print(count - T//l+1)