import sys input = sys.stdin.readline n = int(input()) now = ans = 0 i = 0 d = [2, 2, -1, -1, 2, -1, -1] while(now != n): now += d[i] ans += abs(d[i]) i += 1; i %= 7 print(ans)