f = input() s_f = f.split() L = int(s_f[0]) K = int(s_f[1]) i = 1 while 2 * i * K < L: i += 1 a = ( i - 1 ) * K print(a)