#include int main() { int x; scanf("%d", &x); int ans, now, i; int dx[7] = { 2,2,-1,-1,2,-1,-1 }; ans = now = 0; for (i = 0;; i = (i + 1) % 7) { now += dx[i]; if (dx[i] < 0) ans -= dx[i]; else ans += dx[i]; if (now == x) break; } printf("%d", ans); return 0; }