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