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 sys
from os import path
if(path.exists('Input.txt')):
    sys.stdin = open("Input.txt","r")
    sys.stdout = open("Output.txt","w")
import math 
from math import gcd,floor,sqrt,log,ceil,inf
from collections import *
from collections import deque as deq
from collections import Counter as cnt
from bisect import bisect_left as bl
from bisect import bisect_right as br
def li(): return list(map(int, sys.stdin.readline().split()))
def mp(): return map(int, sys.stdin.readline().split())
def inp(): return int(sys.stdin.readline())
def st(): return str(input())
def strip(): return list(sys.stdin.readline().strip())
def pr(n): return sys.stdout.write(str(n)+"\n")
def prl(n): return sys.stdout.write(str(n)+" ")
def prlist(a): print("".join(a))
mod = 1000000007
maximum, minimum = float('inf'), float('-inf')
bi=lambda n: bin(n).replace("0b", "") 
yes=lambda : print("YES") ; no=lambda : print("NO")

import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom
    
def fact(n):
	return math.factorial(n)
	
def perfect(n):
	return floor(sqrt(n))==ceil(sqrt(n))
def lcm(a, b):
    return a * b // gcd(a, b)
    
def binarySearch(array, target, start, end):
    while start <= end:
        mid = (start + end) // 2
        if array[mid] == target:
            return mid
        elif array[mid] > target:
            end = mid - 1
        else:
            start = mid + 1
    return -1
    
def isPrime(n):
	if (n % 2 == 0 and n != 2) or n < 2:
	    return False
	i = 3
	while i * i <= n:
	    if n % i == 0:
	        return False
	    i += 2
	return True
	
def expo(a, n, M):
    ans = 1
    while(n > 0):
        last_bit = n&1
        if(last_bit):
            ans = (ans*a)%M
        a = (a*a)%M
        n = n >> 1
    return ans
    
def solve():
    s,f=input(),input()
    s,f,x=s[::-1],f[::-1],0
    for i in range(len(s)):
        if i<len(f) and s[i]==f[i]:
            x+=2
        else:
            break
    ans=len(s)+len(f)-x
    pr(ans)
    
for pratyush in range(1):
	solve()