from math import gcd T,A,B=map(int,input().split()) L=(A//gcd(A,B))*B print((T-1)//A+(T-1)//B-(T-1)//L+1)