#include using longlong=long long; int main(){ int a,b;std::cin>>a>>b; std::cout<<(a-1)/(2*b)*b<