import math T, A, B = map(int, input().split()) ans = ((T-1)//A) + ((T-1)//B) - ((T-1)//math.lcm(A, B)) + 1 print(ans)