T, A, B = map(int,input().split()) La = [] C = 0 for i in range(1, B+1): La.append(A*i) for i in range(1, A+1): if B*i in La: C = B*i break ca = 1 + ((T-1) // A) cb = 1 + ((T-1) // B) sub = 1 + ((T-1) // C) cnt = ca + cb - sub print(cnt)