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