L, K = map(int, input().split(' ')) count_up = 0 count = 0 while count_up + K * 2 < L: count_up = count_up + K * 2 count = count + 1 print(count * K)