import math t,a,b=map(int,input().split()) c=a*b//math.gcd(a,b) x=t//a+(t%a>0)+t//b+(t%b>0)-t//c-(t%c>0) print(x)