from fractions import gcd T,A,B = [int(x) for x in raw_input().split()] T -= 1; AB=A*B/gcd(A,B); print(T/A + T/B - T/AB + 1)