#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int X; cin >> X; int ans = 0, pos = 0; auto f = [&]() { if(pos == X) { cout << ans << endl; exit(0); } }; auto A = [&]() { pos += 2; ans += 2; f(); }; auto B = [&]() { pos -= 1; ans += 1; f(); }; for(int i = 0; i < 100; i++) { A(); A(); B(); B(); A(); B(); B(); } }