from math import gcd T,A,B = map(int,input().split()) T += 1 lcm = A * B // gcd(A, B) print((T // A) + (T // B) - (T // lcm))