#include int main(){ int L, K; int divi; double tmp; scanf("%d %d", &L, &K); divi = (L/2)/K; tmp = (L/2.0)/K; if(divi == 0){ printf("0\n"); }else if(tmp != divi){ printf("%d\n", K*(divi)); }else{ printf("%d\n", K*(divi - 1)); } return 0; }