N, A, B = map(int, input().split()) count = 0 for x in range(0, N + 1): if not (x % A == 0 and x % B == 0): count += 1 print(count)