#include int main() { int L, K; int ans = 0; std::cin >> L >> K; ans = K * ((L-1) / (2 * K)); std::cout << ans << std::endl; return 0; }