#include using namespace std; int main() { int l, k; scanf("%d %d", &l, &k); printf("%d\n", k * ((l - 1) / (2 * k))); return 0; }