var n:integer;
    a:array[1..10000] of longint;
    i, j, s, k:longint;
begin
  readln(n);
  for i := 1 to n do
    readln(a[i]);
  for i := 1 to n do
  begin
    k := 0;
    for j := i + 1 to n do
      if a[i] = a[j] then
        k := k + 1;
    if k = 0 then
      s := s + a[i];
  end;
  writeln(s)
end.