main = do getLine vs <- map read . words <$> getLine :: IO [Int] putStrLn $ show $ maxTaste vs maxTaste :: [Int] -> Int maxTaste [] = 0 maxTaste [v] = v maxTaste (v:v':vs) = max (v + maxTaste vs) (maxTaste (v':vs))