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