let scan_int () = Scanf.scanf " %d" (fun x -> x)
let scan_array len read_func = Array.init len (fun _ -> read_func())
let print_int n = Printf.printf "%d\n" n

let () =
  let n = scan_int() in
  let d = scan_array n scan_int in
  let ans = ref 0 in
  let _ =
    for i = 0 to n-2 do
      for j = i+1 to n-1 do
        ans := !ans + d.(i) * d.(j)
      done
    done in
  print_int !ans
