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