from math import gcd t, a, b = map(int, input().split()) print((t - 1) // a + (t - 1) // b - (t - 1) // (a * b // gcd(a, b)) + 1)