D. Combination Lock
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A combination lock contains several dials. Each dial is marked with numbers from 0 to 9 (after 9 comes 0 again).

In one action, you can grasp one or two adjacent dials with your fingers and rotate them together at any angle. Determine the minimum number of such actions required to open the lock.

Input

The first line of the input data contains the initial code on the lock. The second line contains the code to open the lock. The lengths of the lines are equal and do not exceed $$$10^5$$$.

Output

Print one integer — the minimum number of actions to open the lock.

Example
Input
0000
7329
Output
3
Note

In the example, you can proceed as follows. Rotate the first (top) disk to get the code 7000. Then rotate the second and third disks simultaneously to get the code 7330. Finally, rotate the last two disks simultaneously to get the code 7329. A total of 3 steps.