#include using namespace std; int main(){ int l,k; cin>>l>>k; int x; x=0; while(1){ if(l<=2*k){ break; } l-=2*k; x+=k; } cout<