#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { int l, k; cin >> l >> k; int q = l / (2 * k) - (l % (2 * k) == 0); cout << k * q << endl; }