Scanf.scanf "%d" (fun n ->
    let rec loop i acc highest =
        if i = n then acc else
            let h = Scanf.scanf " %d" (fun h -> h) in
            if h >= highest then loop (i + 1) (acc + 1) h else loop (i + 1) acc highest
    in
    loop 0 0 0 |> Printf.printf "%d\n"
)