min, max, litter = map(int, input().split()) changes = [] for i in range(min, max + 1): change = int((str(i * litter)[-3]) + "00") changes.append(change) else: changes.sort() print(changes[0])