#include using namespace std; int main() { int x; cin >> x; int now = 0, ans = 0, cnt = 0; vector d {2, 2, -1, -1, 2, -1, -1}; while (x != now) { int next = now + d[cnt % 7]; ans += abs(d[cnt % 7]); ++cnt; now = next; } cout << ans << endl; return 0; }