import math t,a,b=map(int,input().split()) h=a*b//math.gcd(a,b) t-=1 print(t//a+t//b-t//h+1)