#include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A int main() { CIN( ll , L ); CIN( ll , K ); const ll K2 = K * 2; cout << ( L / K2 - ( L % K2 == 0 ? 1 : 0 ) ) * K << endl; return 0; }