-3+1

ZOJ is 10 years old! For celebrating, we are offering the easiest problem in the world to you.

Recently we received a long sequence. We can modify the sequence once by the following two steps.

Choose any element in the sequence, say x(satisfying x ≥ 3), and subtract 3 from x.
Choose any element in the sequence, say x, and add 1 to x.
Now, we want to know how many times at most the sequence can be modified.

Input

The input contains multiple test cases. For each case, the first line contains an integer n(1 ≤ n ≤ 20000). The second line contains n integers describing the sequence. All the numbers in the sequence are non-negative and not greater than 1000000.

Output

Output number of times at most the sequence can be modified, one line per case.

Sample Input

1
10
2
10 11
Sample Output

4
10

https://wenku.baidu.com/view/a0820ed2ce2f0066f533228f.html

http://www.cnblogs.com/zhourongqing/archive/2012/03/12/2392503.html