
main = do
  [n,m,x] <- map read . words <$> getLine :: IO [Int]
  al <- map read . words <$> getLine :: IO [Int]
  print $ solve al x

solve al x =
  let (f,s) = (splitAt x al) in
    maximum $ map sum [f,s]
    