Intercity Tickets
Vasya frequently travels on intercity buses, and the tickets for these buses are rectangular, featuring a grid of numbers with 4 rows and 10 digits each, along with the word "Ticket" on both sides. Each side of a cell containing a digit measures 1 cm.
The first row represents the thousands digit of the ticket price, the second row the hundreds digit, the third row the tens digit, and the fourth row the units digit.
The driver uses scissors to cut this grid into 2 parts (left and right relative to the cutting line). The thousands digit of the ticket price is the rightmost digit remaining to the left of the cutting line in the first row. Similarly, the hundreds digit is the rightmost digit remaining to the left of the cutting line in the second row, and so forth. For example, if the ticket price is 2091, the driver will cut the ticket as shown below (the cutting line is indicated in bold):
It is guaranteed that the driver will not cut along the top or bottom edges of the ticket.
Vasya is curious about how long it will take the driver to cut the ticket. Through experimentation, Vasya discovered that the driver cuts one centimeter of the ticket in one second. Your task is to determine how many seconds it will take the driver to issue the ticket.
All numbers in this problem are integers.
Input
The input consists of a single number N — the price of Vasya's ticket (1 ≤ N ≤ 9999).
Output
Output the number of seconds it will take the driver to issue Vasya's ticket.