ope = [2,2,-1,-1,2,-1,-1] X = int(input()) x = 0 ans = 0 for i in range(100): d = ope[i%7] x += d ans += abs(d) if x == X: break print(ans)