def otosidama(N, M): if N < M * 1000: return 0 else: par = (N // 1000) // M return par * 1000 N, M = (int(x) for x in input().split()) orosidama(N, M)