Cacti in a row#4330

Cacti in a row

2 seconds
256 megabytes
Easy

Before the president's visit to "Beredeue Polyantli," a decision was made to rearrange the cacti. Currently, the cacti are lined up in a row, and the species of each cactus is known.

The design shaman, Eogenkuprilyantl, aims to transplant the cacti to create a new, more harmonious sequence of species.

Eogenkuprilyantl will bring along a certain number of students (denoted as ) and will repeatedly perform the following steps:

No cactus can be uprooted and replanted more than once.

What is the minimum number of students Eogenkuprilyantl will need to reorder the cacti into the desired sequence?

Input

The first and second lines contain the current and desired sequences of cactus species, respectively. Each sequence is a string of lowercase Latin letters, where different letters represent different cactus species. Both strings are of the same length, not exceeding .

Output

If it is impossible to achieve the desired sequence of cactus species, output . Otherwise, output a non-negative number - the minimum number of students required to achieve the desired result.

Examples

Example 1

Loading
Loading