#include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) int main() { long long L, K; cin >>L>>K;cout<<(L-1)/(K<<1)*K<