L,K = (int(x) for x in input().split()) num = int(L/(2*K)) cnt = num*K print(cnt)