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