#include <bits/stdc++.h> using namespace std; int main() { long long L, K, ans = 0; cin >> L >> K; while(true) { L -= K * 2; if(L <= 0) break; ans += K; } cout << ans << endl; return 0; }