T,A,B=map(int,input().split()) a=(T-1)//A+1 b=(T-1)//B+1 def gcd(A,B): if B>A: A,B=B,A while A%B!=0: A,B=B,A%B return B c=(T-1)//(A*B//gcd(A,B))+1 print(a+b-c)