import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines x,y = map(int,read().split()) t = (x - 1) // (y + y) answer = y * t print(answer)