Given counts of balls in K colors, pack them into boxes of capacity K where each box is all one color or all distinct colors, using as few boxes as possible.
The balls come in KKK colors. A color is an integer from 1 to KKK, and there are XiX_iXi balls of color iii.
You want to pack all of the balls into boxes. One box holds at most KKK balls.
The balls inside one box must all have different colors, or must all have the same color.
Write a program that finds the minimum number of boxes you need.
The first line contains the number of colors KKK. (1≤K≤100,0001 \le K \le 100{,}0001≤K≤100,000)
The second line contains X1,X2,…,XKX_1, X_2, \dots, X_KX1,X2,…,XK, the ball counts of color 1 through color KKK, separated by spaces. (1≤Xi≤1,000,000,0001 \le X_i \le 1{,}000{,}000{,}0001≤Xi≤1,000,000,000)
Print the minimum number of boxes on the first line.