(* O(n) *)
let solve n a_s =
  let sum, has_zero, mi, neg_count =
    List.fold_left
      (fun (sum, has_zero, mi, neg_count) a ->
        let abs_a = abs a in
        sum + abs_a,
        (if not has_zero then a = 0 else has_zero),
        min mi abs_a,
        if a < 0 then neg_count + 1 else neg_count)
      (0, false, max_int, 0)
      a_s
  in
    if has_zero || neg_count mod 2 = 0 then
      sum
    else 
      sum - mi * 2

let read_ints () = read_line () |> Str.split (Str.regexp " ") |> List.map int_of_string
let _ =
  let n = read_int () in
  read_ints () |> solve n |> string_of_int |> print_endline