misMatch :: String -> String -> Int
misMatch [] _ = 0
misMatch _ [] = 0
misMatch (s:ss) (t:ts) = if s == t then misMatch ss ts else 1 + misMatch ss ts

solve :: String -> String -> [Int]
solve ss ts
    | length ss <= length ts = [misMatch (take (length ts) ss) ts]
    | otherwise = misMatch (take (length ts) ss) ts : solve (tail ss) ts

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