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