x = int(input()) now = ans = 0 i = 0 d = [2, 2, -1, -1, 2, -1, -1] while(now != x): now += d[i] ans += abs(d[i]) i += 1; i %= 7 print(ans)