#include using namespace std; int main(){ int L,K; cin>>L>>K; cout<<(L/(K*2)-(L%(K*2)==0))*K<