#include using namespace std; int main() { int l , k; cin >> l >> k; cout << (l/2) - (l%(k+1)) << endl; return 0; }