Problem: 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.

Input

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⋅10^5, inclusive.

Output

Output the fewest number of moves required. 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 given strings.

Examples

Input

test
west


Output

2


Input

codeforces
yes


Output

9


Input

test
yes


Output

7


Input

b
ab


Output

1

Note

In the first example, you should apply the move once to the first string and apply the move once to the second string. As a result, both strings will be equal to "est".

In the second example, the move should be applied to the string "codeforces" 8 times. As a result, the string becomes "codeforces" → "es". The move should be applied to the string "yes" once. The result is the same string "yes" → "es".

In the third example, you can make the strings equal only by completely deleting them. That is, in the end, both strings will be empty.

In the fourth example, the first character of the second string should be deleted.

Solution (in PYTHON3):

Solution:
#!/usr/bin/env python
# coding: utf-8

# In[4]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     if a%b==0 or a%b<=1.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(math.floor(b*no))


# In[10]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     frac,asd=math.modf(a/b)
#     if a%b==0 or frac<=.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(int(b*no))


# In[4]:


# n=int(input())
# s=input()
# d={}
# a=0
# for i in range(n-1):
#     a=s[i]+s[i+1]
#     if d.get(a):
#         d[a]+=1
#     else:
#         d[a]=1
# max_key = max(d, key=d.get)
# print(max_key)
    
    


# In[ ]:


# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# a.sort()
# if k==0 and a[0]==0:
#     print(-1)
# elif k==0 and a[0]==1:
#     print(-1)
# elif k==0:
#     print(a[0]-1)
# elif  len(a)>1  and k!=n and a[k]==a[k-1] :print(-1)
# else:print(a[k-1])


# In[1]:


# n=int(input())
# a=list(map(int,input().split()))
# k=0
# while k<n:
#     for i in range(n):
#         f=1
#         if a[i]==-1:pass
#         elif a[i]%3==0:
#             for j in range(n):
#                 if a[j]==a[i]//3:
#                     print(a[i],end=' ')
#                     print(a[j],end=' ')
#                     a[i],a[j]=-1,-1
#                     f=0
#                     k+=1
#                     break
# #             if f :
# #                 for j in range(n):
# #                 if a[j]==a[i]*2:
# #                     print(a[i],end=' ')
# #                     print(a[j],end=' ')
# #                     a[i],a[j]=-1,-1
# #                     f=0
# #                     k+=1
#             break
        
#     for i in range(n):
#         f=1
#         if a[i]==-1:pass
#         elif a[i]%2==0:
#             for j in range(n):
#                 if a[j]==a[i]*2:
#                     print(a[i],end=' ')
#                     print(a[j],end=' ')
#                     a[i],a[j]=-1,-1
#                     f=0
#                     k+=1
#                     break
                    
#             break


# In[15]:


# n=int(input())
# a=list(map(int,input().split()))
# d={}
# lis=[]
# for i in a:
#     if d.get(i):pass
#     else:
#         d[i]=1
# l=len(d)
# while l>0:
#     if d[a[n-1]]:
#         lis.append(a[n-1])
#         d[a[n-1]]=0
#         l-=1
#     n-=1

# lis.reverse()
# print(len(d))
# for i in lis:
#     print(i,end=" ")
        


# In[20]:


# n=int(input())
# s=input()
# ans,c=0,0
# for i in s:
# #     print(i,c)
#     if i=='x':
#         c+=1
#     else:
#         if c>=3:ans+=c-2
#         c=0
# if c>=3:ans+=c-2
# print(ans)


# In[24]:


# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# t=list(map(int,input().split()))
# s=0
# for i in range(n):
#     a[i]+=s
#     s=a[i]
    

# for i in t:

#     for j in range(n):
#         if j==0 and a[j]>=i:
#             print(1,abs(i))
#             break
            
#         elif a[j]>=i:
#             print(j+1,abs(a[j-1]-i))
#             break


# In[24]:


# a=[10,25,37]
# n=3
# def bsearch(no):
#     low=0
#     high=n
#     mid=(low+high)//2
#     while high-low>1:
#         if a[mid]==no:return mid
#         print(high,low,mid)
#         if no>a[mid]:low=mid
#         elif no<a[mid]:high=mid
#         mid=(low+high)//2
#     return high

# print(bsearch(12))


# In[ ]:



# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# t=list(map(int,input().split()))

# def bsearch(no):
#     low=0
#     high=n
#     mid=(low+high)//2
#     while high-low>1:
#         if a[mid]==no:return mid
#         # print(high,low,mid)
#         if no>a[mid]:low=mid
#         elif no<a[mid]:high=mid
#         mid=(low+high)//2
#     return high
    
# s=0
# for i in range(n):
#     a[i]+=s
#     s=a[i]
    

# for i in t:
    
#     if i<=a[0]:
#         print(1,abs(i))
#     else:
#         j=bsearch(i)
#         print(j+1,abs(i-a[j-1]))


# In[ ]:


# for test_case in range(int(input())):
#     n,k=map(int,input().split())
#     s=input()
#     c,ans=0,0
#     for i in s:
#         if i=='0':
#             c+=1
#             if c==(2*k)+1:
#                 ans+=1
#                 c=0
#     if c==(2*k)+1:
#                 ans+=1
#                 c=0
#     print(ans)
                
        
        
    


# In[ ]:


# for test_case in range(int(input())):
#     n=int(input())
#     a=list(map(int,input().split()))
#     a.sort()
#     ans=1000000000
#     for i in range(n-1):
#         ans=min(ans,abs(a[i+1]-a[i]))
#     print(ans)


# In[1]:


# for test_case in range(int(input())):
#     n=int(input())
#     a=list(map(int,input().split()))
#     a.sort()
#     i,d=0,{}
#     par,p,o=0,0,0
#     for i in a:
#         # print(p,o)
#         if d.get(i-1):
#             # print("yahh",i,"asd")
#             # print(i)
#             d[i-1]-=1
#             if i %2==0:o-=1
#             else:p-=1
            
            

#         elif i%2==0:
#             if d.get(i) or d.get(i)==0:d[i]+=1
#             else:d[i]=1
#             p+=1
#         else:
#             if d.get(i) or d.get(i)==0:d[i]+=1
#             else:d[i]=1
#             o+=1
        
        
        
#     if o%2!=0 or p%2!=0:print("NO")
#     else :print("YES")


# In[ ]:


# for i in range(int(input())):
#     n,k=map(int,input().split())
#     f=1
#     if k ==1:
#         print(n)
#         f=0
#     elif k>=n:
#         print(1)
#         f=0
#     else:
#         for i in range(2,int(n**.5)+1):
#             if n%i==0 and i<=k and n//i<=k:
#                 print(min(i,n//i))
#                 f=0
#                 break
#     if f:print(n)


# In[1]:


# n,k=map(int,input().split())
# S=[input().strip() for i in range(n)]
# SET=set(S)
# ANS=0
 
# for i in range(n-1):
#     for j in range(i+1,n):
        
#         rest=''
#         for l in range(k):
#             if S[i][l]==S[j][l]:
#                 rest+=S[i][l]
#             else:
#                 rest+=chr(236-ord(S[i][l])-ord(S[j][l]))
 
#         if rest in SET:
#             ANS+=1
# print(ANS//3)


# In[4]:


s1=input()
s2=input()
l1=len(s1)
l2=len(s2)
l=min(l1,l2)
i,j,f=0,0,1
if len(s1)==0:print(len(s2))
elif len(s2)==0:print(len(s2))
elif s1[-1]!=s2[-1]:print(l1+l2)

else:
    while f:
        i+=1
        if i==l+1:break
        elif s1[l1-i]!=s2[l2-i]:
            f=0
    i-=1
    print(l1+l2-(2*i),)
        


# In[3]:





# In[ ]: