#yuki894 def gcd(x,y): while y: x,y=y,x%y return x def lcm(x,y): return x*y/gcd(x,y) t,a,b=map(int,raw_input().split()) t-=1 print t/a+t/b+1-t/lcm(a,b)