#include int main(void) { int L, K, count=0; scanf("%d%d", &L, &K); if (L > 2 * K) { while (1) { L -= 2 * K; count++; if (L <= 2 * K) break; } } printf("%d\n", count * K); return 0; }