#include int main() { int L,K; scanf("%d%d",&L,&K); printf("%d\n",((L-1)/(2*K))*K); return 0; }