#include using namespace std; #define REP(i,N) for(i=0;i P; typedef struct{ int first; int second; int third; }T; //昇順 bool comp_Se(T& l, T& r){ return l.second < r.second; } int main(void){ ll L,K,y=0; cin >> L >> K; while(L>0){ if(L>2*K){ L-=2*K; y+=K; }else break; } cout << y << endl; return 0; }