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