def gcd(x,y): while y: x,y=y,x%y return x N,A,B=map(int, input().split()) x=gcd(A,B) C=A*B//x a=N//A b=N//B c=N//C ans=N-a-b+c print(ans)