import           Control.Monad
import           Data.Maybe

input :: IO (String, String)
input = do
  s <- getLine
  t <- getLine
  return (s, t)


diff :: String -> String -> Maybe Int
diff [] y = Nothing
diff x [] = Just 0
diff (x:xs) (y:ys) = if x /= y then (liftM2 (+)) (Just 1) (diff xs ys) else diff xs ys


check :: (String, String) -> [Maybe Int] -> [Maybe Int]
check ([], t) ns       = ns
check (s@(_:ss), t) ns = check (ss, t) ((diff s t) : ns)

output :: [Maybe Int] -> Int
output ns = fromJust . minimum . filter (/= Nothing) $ ns

main :: IO ()
main = do
  (s, t) <- input
  let
    result = output $ check (s, t) []
  print result
