main = do
  s <- getLine
  t <- getLine
  print $ solve s t

d x y = length . filter f $ zip x y
  where
    f (a, b) = a /= b

solve s@(_:ss) t | length s == length t = d s t
                 | otherwise = min ans $ solve ss t
  where
    ans = d t $ take (length t) s