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