solve :: [Int] -> Int
solve a = sum a'
  where
    a' = f a
    f []  = []
    f [x] = [x]
    f (x1:x2:xs)
      | x1 >= 0 && x2 >= 0 = x1 : x2 : f xs
      | x1 < 0 && x2 < 0   = x1*(-1) : x2*(-1) : f xs
      | x1 < 0             = x1*(-1) : f (x2*(-1) : f xs)
      | otherwise          = x1 : f (x2 : f xs)

main :: IO ()
main = do
    _ <- getLine
    a <- map read . words <$> getLine :: IO [Int]
    print $ solve a