# coding: utf-8 l, k = map(int,input().split()) #l = int(input()) #N = int(input()) #W = list(map(int,input().split())) cnt = 0 while True: l -= 2 * k if l > 0: cnt += 1 else: break print(cnt * k)