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