L, K = map(int,input().split()) print([K*((L-1)//(2*K)),0][L <= 2*K])