main :: IO () main = do getLine vs <- map read . words <$> getLine print $ solve vs solve :: Integral a => [a] -> a solve [] = 0 solve [v] = v solve vs = max t1 t2 where t1 = head vs + solve (drop 2 vs) t2 = solve (tail vs)