#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int X; cin >> X; int cur = 0, ans = 0; vector d = {2, 2, -1, -1, 2, -1, -1}; int idx = 0; while (cur != X) { cur += d[idx]; ans += abs(d[idx]); idx = (idx + 1) % 7; } cout << ans << "\n"; return 0; }