#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(){ ll n,a; cin >> n >> a; a *= 2; ll k = n / a; if(n % a == 0)k--; cout << k * a / 2 << endl; }