From Hexo
Useful 思考题!!

# Replace

Hikari is a cute white dragon girl. She is helping Ninetail - a fox girl, her master - correct composition.The original composition is a string S and the corrected one is another string T.

Hikari claimed that she used a single replaceAll function in doc to finish the correction. The function requires a from string and a to string and will replace all from with to in the string S. Your task is to find out what's the minimum sum of characters of from and to to finish the change in one replaceAll.

## Example

S="my father is my mother's father"
T="my mother is my mother's mother"
output=4


In this example, from=fa to=mo

S="My pen is missing! Can you find my pen?"
T="My pens is missing! Can you find my pen?"
output=5


from=<space>i to=s<space>i

S="yp"
T="zjs"
output=5


from=yp to=zjs