#include using namespace std; int main() { int L, K; cin >> L >> K; int answer; for(answer = 0; answer + K < L / 2.0; answer += K); cout << answer << endl; return 0; }