For a multiset $$$T$$$ consisting of non-negative integers, we define:
- $$$\text{sum}(T)$$$ is the sum of all elements in $$$T$$$. For example, if $$$T = \{0,1, 1, 3\}$$$, then $$$\text{sum}(T)= 0+1+1+3=5$$$.
- $$$\text{mex}(T)$$$ is the smallest non-negative integer not in $$$T$$$. For example, if $$$T = \{0,1, 1, 3\}$$$, then $$$\text{mex}(T) = 2$$$ because $$$2$$$ is the smallest non-negative integer not present in $$$T$$$.
You are given a multiset $$$S$$$ of size $$$n$$$ consisting of non-negative integers. At first, your score is $$$0$$$. You can perform the following operations any number of times in any order (possibly zero):
- Select a subset $$$S' \subseteq S$$$ (i.e., $$$S'$$$ contains some of the elements currently in $$$S$$$), add $$$\text{sum}(S')$$$ to your score, and then remove $$$S'$$$ from $$$S$$$.
- Select a subset $$$S' \subseteq S$$$, add $$$\text{mex}(S')$$$ to your score, and then remove $$$S'$$$ from $$$S$$$.
Find the maximum possible score that can be obtained.
Output
For each test case, print a single integer — the maximum possible score that can be obtained.
Note
In the first test case, a possible optimal strategy is as follows:
- Select $$$S'=\{0,1\}$$$, add $$$\text{mex}(S')=\text{mex}(\{0,1\})=2$$$ to your score, and then remove $$$S'$$$ from $$$S$$$. Currently, your score is $$$2$$$ and $$$S=\{1\}$$$.
- Select $$$S'=\{1\}$$$, add $$$\text{sum}(S')=\text{sum}(\{1\})=1$$$ to your score, and then remove $$$S'$$$ from $$$S$$$. Currently, your score is $$$3$$$ and $$$S=\varnothing$$$.
After that, you cannot do any further operations. It can be proven that $$$3$$$ is the maximum possible score that can be obtained.