let n = stdin.ReadLine() |> int let elem8 x = x |> string |> Seq.toArray |> Seq.contains '8' [| 0..n |] |> Array.filter elem8 |> Array.length |> printfn "%d"