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