open System
open System.Collections
open System.Collections.Generic
open System.IO
open System.Linq
open System.Net
open System.Security.Cryptography.X509Certificates

type IO<'T> = private | Action of (unit -> 'T)
[<AutoOpen>]
module IO =
    let private raw  (Action f) = f
    let private run  io         = raw io ()
    let private eff  g   io     = raw io () |> g
    let private bind io  rest   = Action (fun () -> io |> eff rest |> run)
    let private comb io1 io2    = Action (fun () -> run io1; run io2)
    
    type IOBuilder() =
        member b.Return(x)              = Action (fun () -> x)
        member b.ReturnFrom(io) : IO<_> = io
        member b.Delay(g) : IO<_>       = g ()
        member b.Bind(io, rest)         = bind io rest
        member b.Combine(io1, io2)      = comb io1 io2

    let io = new IOBuilder()
    let (|Action|) io = run io

    let write     (x:obj) = Action (fun () -> stdout.Write(x))
    let writeLine (x:obj) = Action (fun () -> stdout.WriteLine(x))
    let read              = Action (fun () -> stdin.ReadLine())

[<EntryPoint>]
let main _ = 
    let (Action())= io{
        let! l1 = read
        let x = l1 |> int64
        let ans = 
            let a = (x / 11L) * 2L
            let b = 
                let t = x % 11L
                if   t =  0L then 0L
                elif t <= 6L then 1L
                else              2L
            a + b
        return! writeLine ans
    }
              
    0
    

