#include #include #include #include #include #include using namespace std; #define diff(x,y) ((x > y) ? (x - y) : (y - x)) #define us(x) (x > 0) ? x : x * -1 int main() { long long int L, K, ans = 0; cin >> L >> K; while (L > 2 * K) { L -= 2 * K; ans += K; } cout << ans << endl; return 0; }