flage=0
def finddi(s1,s2):
for i in range(len(s1)):
if s1[i]!=s2[i]:
return i
def fanzhuani(s1):
i=finddi(s1,s2)
r=list(s1)
if r[i]=="":
r[i]="o"
else: r[i]=""
if r[i+1] == "":
r[i+1] = "o"
else:
r[i+1] = ""
result="".join(r)
return result
s1=input()
s2=input()
while(1):
s1=fanzhuani(s1)
flage+=1
if s1==s2:
print(flage)
exit(0)