L, K = map( int, input().split() ) Yuchan= 0 for i in range(L): L -= 2 * K if L <= 0: break Yuchan += K print(Yuchan)