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