s=input()
t=input()
count=0
temp=''
for i in range(len(s)):
if(s[i]>='0' and s[i]<='9'):
temp=s[0:i]+s[i+1:]
if(temp < t):
count+=1
temp=''
for i in range(len(t)):
if(t[i]>='0' and t[i]<='9'):
temp=t[0:i]+t[i+1:]
if(temp > s):
count+=1
temp=''
print(count)
To embed this program on your website, copy the following code and paste it into your website's HTML: