You are given two strings $s$ and $t$. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by $1$. You can't choose a string if it is empty.

For example:
 -  by applying a move to the string "where", the result is the string "here", -  by applying a move to the string "a", the result is an empty string "". 
You are required to make two given strings equal using the fewest number of moves. It is possible that, in the end, both strings will be equal to the empty string, and so, are equal to each other. In this case, the answer is obviously the sum of the lengths of the initial strings.

Write a program that finds the minimum number of moves to make two given strings $s$ and $t$ equal.
The first line of the input contains $s$. In the second line of the input contains $t$. Both strings consist only of lowercase Latin letters. The number of letters in each string is between 1 and $2\cdot10^5$, inclusive.
test
west
2
codeforces
yes
9
test
yes
7
b
ab
1
z
z
0
abacabadabacaba
abacabadacaba
18
z
a
2
ama
sama
1
aaabc
bc
3
lxuyspmieeuyxluv
dfwxqvavzxctblaa
32
ahmedaly
aly
5
aa
a
1
aa
ba
2
cccba
ba
3
a
ab
3
dadc
dddc
4
aacaaab
b
6
dddc
cdcde
9
bbdab
dab
2
a
aa
1
aa
ab
4
codeforces
ces
7
import math, heapq
from sys import stdin	
from collections import Counter, defaultdict, deque, namedtuple
from bisect import bisect_right, bisect_left
from typing import List, DefaultDict
from itertools import permutations
from copy import deepcopy

 
def sieve_of_eratosthenes(n):
    is_prime = [True] * (n+1)
    is_prime[0] = is_prime[1] = False
    for p in range(2, int(n**0.5)+1):
        if is_prime[p]:
            for i in range(p*p, n+1, p):
                is_prime[i] = False
                
    for i in range(2, n+1):
        if is_prime[i]:
            print(i, end=' ')


def isPowerOf2(n):

    def log2(x):

        if x == 0:
            return False

        return (math.log10(x)/math.log10(2))


    return math.ceil(log2(n)) == math.floor(log2(n))

 
def readarray(typ):
    return list(map(typ, stdin.readline().split()))


def readint():
    return int(input())


s = deque(list(input()))
t = deque(list(input()))

n, m = len(s), len(t)

ans = 0
while s and t and s != t:

    if len(s) == len(t):
        s.popleft()
        t.popleft()
        ans += 1
    elif len(s) > len(t):
        s.popleft()
    else:
        t.popleft()
    
    ans += 1


if s == t:
    print(ans)
else:
    print(n + m)
