stdin.ReadLine() |> ignore let l = stdin.ReadLine().Split([|' '|]) |> Seq.map (int) |> Seq.toList let f = List.fold (fun (a,b) n -> (max a (b+n)),a) (0,0) printfn "%d" <| (f >> fst) l