#include using namespace std; int main() { int len, x; int num; cin >> len >> x; num = len / 2; cout << (num/x) * x << endl; return 0; }