T,A,B = map(int, input().split()) def gcd(a, b): if a < b: a,b = b,a if a % b == 0: return b return gcd(b, a%b) lcm = A*B//gcd(A, B) ans = (T-1)//A + (T-1)//B - (T-1)//lcm + 1 print(ans)