Hard

Execution time limit is 0.5 seconds

Runtime memory usage limit is 64 megabytes

India's largest mathematics XII century. Bhaskara belongs to the treatise "Siddhanta-Shiromani" ("Teachings of the crown"), rewritten in the XIII century. on strips of palm leaves. This treatise consists of four parts, of which "Lilavati" is devoted to arithmetic, "Bidzhaganita" - algebra, the other two parts of astronomy. "Lilavati" (which means "beautiful") Bhaskara devoted to his daughter.

Many of their puzzles Bhaskara expounded in poetic form, here's one:

From the set of pure lotus The third part has been brought in gift Shiva The fifth part - Vishnu, the sixth - the Sun; The fourth part of all flowers received Bhvani, The remaining six flowers were given to highly esteemed Teacher.

We can not literally convey the charm and beauty of the sound of these poems of ancient India, so our puzzle formulated in prose. So this is a little problem in general terms: "The gift of Lord Shiva brought A-th part of lotus flowers, a gift of Lord Vishnu - B-th part of the gift the Sun - C-th part, for Bhvani got D-nd of the highly esteemed Teacher and received E flowers. How many lotus flowers were available to those who gave?"

In the first and only line of the input data set through the gap 5 of integers: A, B, C, D and E, each of which does not exceed 100.

Derive a single number - the answer to the problem, or -1 if the input data are inconsistent, or they solve puzzle certainly not given the opportunity.

Input #1

Answer #1