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