polycarp n friend ith friend a_i candy Polycarps friend like different number candy in word want a_i to solve Polycarp perform follow set action exactly Polycarp choose k 0 le k le n arbitrary friend let choose friend index i_1 i_2 ldot i_k Polycarp distribute a_i_1 a_i_2 ldot a_i_k candy n friend during distribution a_i_1 a_i_2 ldot a_i_k candy choose new owner that n friend note candy give person own candy distribution process note number k fix advance arbitrary your task find minimum value kFor example n4 a4 5 2 5 polycarp follow distribution candy Polycarp choose k2 friend indice i2 4 distribute a_2 a_4 10 candy a4 4 4 4 candy person 3 note example Polycarp choose k1 friend redistribute candy end a_i equalFor datum n determine minimum value k with value k Polycarp able select k friend redistribute candy end number candy