#include using namespace std; int main(){ int l, k, ate = 0; cin >> l >> k; while (l > 2 * k){ l -= (2 * k); ate += k; } cout << ate << endl; return 0; }