def max(a,b)
  if a<b
    return b
  else
    return a
  end
end
def min(a,b)
  if a<b
    return a
  else
    return b
  end
end

s1=gets.chomp
s2=gets.chomp
n=max(s1.length,s2.length)
m=min(s1.length,s2.length)

d=Array.new(n,0)
for i in 0..m-1
  if s1[i]==s2[i]
    d[i]=d[i-1]
  else
    d[i]=d[i-1]+1
  end
end
for i in m..n-1
  d[i]=d[i-1]+1
end
print d[n-1],"\n"