## DMOPC '20 Contest 5 P1 - Home Row

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

As a 30 WPM typer, you are sitting in a computer lab playing a modified version of TypeRacer in hopes of increasing your typing speed. In this game, your goal is to transform a given string of lowercase characters into a new string of lowercase characters . is the string you start with on your screen. In one keystroke, you can delete a character from the back of the current string on your screen, or you can add a new lowercase character to the back of the current string. Since you strive to be as fast as possible, please compute the minimum number of keystrokes needed to transform into .

#### Constraints

, where denotes the number of characters in .

and only contain lowercase characters.

#### Input Specification

The first line contains the string .

The second line contains the string .

#### Output Specification

Output one integer, the minimum number of keystrokes needed to transform into .

#### Sample Input 1

adachi
shimamura

#### Sample Output 1

15

#### Sample Input 2

shinomiya
shirogane

#### Sample Output 2

12