def Gcd(m,n) : while m % n != 0 : temp = n n = m % n m = temp return n T,A,B=map(int, input().split()) T -= 1 a = T // A b = T // B commonNum = A * B // Gcd(A,B) aAndB = T // commonNum print(a + b - aAndB + 1)