Under construction

Still being built. Things may change

Winter Supplies

Interview

Time limit2sMemory limit1024 MB

Summary
Given the signed jar numbers left after one jar vanished, find the number on the missing jar, where each absolute value must appear equally often with each sign.
Level

Easy3 of 10

Topics
Hash map, Math
Solved
No attempts yet

Problem

Kopatych is a kind and thrifty gardener bear who grows food for all the Smeshariki. He usually hibernates in winter, but he always leaves plenty of supplies so the others can get through the cold season without worrying.

This year he counted his food and checked how many jars each product filled. Every product fills an even number of jars. In total there are 2k2k jars.

He numbered all the jars. Winter lasts two months. Jars for the first month get negative numbers, and jars for the second month get positive numbers. He followed two rules. First, jars holding the same product have numbers with the same absolute value. Second, each product has the same number of jars for the first month and the second month.

This morning he found that one jar had disappeared overnight. From the numbers on the remaining jars, he wants to find the number on the missing jar.

Input

The first line contains an odd integer nn (1≤n<100 0001 \le n < 100\,000), the number of jars Kopatych has left. The second line contains nn integers aia_i (1≤∣ai∣≤10001 \le |a_i| \le 1000), the numbers on all the remaining jars.

Output

Print one integer, the number written on the missing jar.

Examples1

  1. Example 1

    Input
    5
    42 -1 -42 -5 5
    
    Expected output
    1