let N = stdin.ReadLine() |> int let V = stdin.ReadLine().Split() |> Array.map(int) Array.fold (fun (prepre,pre) x -> let a = prepre + x let b = pre (pre,max a b)) (0,0) V |> snd |> printfn "%i"