Making revolutions in the software industry is not easy, so this problem is about something else. Stanescu has just invented a new, super-cool way to develop software: it is similar to writing program code, but instead of writing it yourself, you ask someone else to do it. This way anyone could create great software without even knowing what a Turing machine is. Stanescu does not really care about the software industry at all — he just wants to make money.
To protect the money he is about to make, he must choose a special password for his bank account that satisfies all of the following requirements:
a is 1, b is 2, and so on). For example, the complexity of the string ala is $1 + 12 + 1 = 14$.? and *, and no longer than 1000 characters). A ? is matched by exactly one arbitrary lowercase Latin letter, and a * is matched by zero or more arbitrary lowercase Latin letters. The whole password must match the whole pattern.Write a program that computes the complexity of the simplest possible password (the one with the smallest complexity).
Several test cases are given in the input. Each of them consists of a single line containing the pattern string and the super-password string, separated by white space.
For each test case, print a single line with one integer: the complexity of the simplest possible password. If no password satisfies the given requirements, print -1.