What can most Phibonachies number be made if you have a set of numbers С_0, С_1, С_2 ... С_9, where С_0 is a quantity of numbers 0, С_1 is a quantity of numbers 1, ... С_9 is a quantity of numbers 9.
There are 10 integers in the one line; each of them follows to quantity of the proper numbers in a set. All of entrance information do not exceed 100.
There is one number. It is a number of Phibonachies’ number, or -1, if the number is notige.