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