#include using namespace std; int main() { int L, K; cin >> L >> K; if (L == (K * 2)) { cout << 0; return 0; } cout << (L / (K * 2)) * K ; return 0; }