#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll N_MAX = 2e5; int main(){ ll x; cin >> x; ll ans = 0; ll now = 0; while(true){ now += 2; ans += 2; if(now == x) break; now += 2; ans += 2; if(now == x) break; now -= 1; ans += 1; if(now == x) break; now -= 1; ans += 1; if(now == x) break; now += 2; ans += 2; if(now == x) break; now -= 1; ans += 1; if(now == x) break; now -= 1; ans += 1; if(now == x) break; } cout << ans << endl; }