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