L,K=map(int, input().split()) i=0 Y=0 K2=2*K #rint(K2) Sh=L//K2 print(Sh*K)