private static void solve(Integer[] in) {
       
           
            int cuts = 0;
            int min = Integer.MAX_VALUE;
            
//            for (int item : in) {
//                if (item > 0 && item < min) {
//                    min = item;
//                }
//            }
//            
            boolean minset = false;
            for (int i = 0; i < in.length; i++) {
            	 if (onlyZeros(in)) {
                     break;
                 }
                if (in[i] <= 0) {
                    continue;
                }
                else
                if(!minset)
                {
                	min = in[i];
                	minset = true;
                }
                
                if(minset==true)
                {
                	in[i] = in[i] - min;
                	cuts++;
                }
                if (i==in.length) minset=false;
            }
            System.out.println(cuts);
       
    }