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