#include int main() { int a, b; scanf("%d", &a); scanf("%d", &b); int tmp = (a - 1) / (2 * b); printf("%d\n", tmp * b); return 0; }