T,A,B=map(int, input().split()) a,b=T//A,T//B if T%A!=0: a+=1 if T%B!=0: b+=1 import math C=(A*B)//math.gcd(A,B) c=T//C if T%C!=0: c+=1 print(a+b-c)