L, K = map(int, raw_input().split()) print K*((L-1)/(2*K))