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