#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int x; cin >> x; int d[] = {2, 2, -1, -1, 2, -1, -1}; int cur = 0, turn = 0, dist = 0; while (true) { if (cur == x) { cout << dist << endl; break; } cur += d[turn % 7]; dist += abs(d[turn % 7]); turn++; } }