L, K = map(int, input().split()) y = 0 while(L > 2*K): y += K L -= 2*K print(y)