Олимпиадный тренинг

Задача 34836. Transfusions


Задача

Темы:
There are 10 flasks with water and the volume of water in each of them is known. For one "touch" you can take one flask and pour some of the water (or all of the water) from this flask into one or more other flasks in any quantity. For what least number of "touches" Is it possible to equalize the volumes of water in all flasks? Each flask can hold any amount of water.
Input data format
The program receives 10 integers ai as input, each written on a separate line — the volume of water in each of the flasks. All numbers — integers, from 0 to 100. 
Weekend format
data Output a single integer — the minimum number of "touches" for which you can equalize the volumes of water in all flasks.
 
Input Output
30
26
2
3
4
5
6
7
8
9
 
2

NoteIn the example, you can pour 20 from the first flask into the second, leaving 10 in the first flask. Then pour water from the second flask into all the other flasks so that each of the flasks contains 10.