import Data.List (tails)

main :: IO()
main = do
    let
        diff :: String -> String -> Int
        diff s t = length . filter not $ zipWith (==) s t
    s <- getLine :: IO String
    let
        l = length s :: Int 
    t <- getLine :: IO String
    let
        m = length t :: Int 
    print . minimum . map (diff t) . take (l - m + 1) . tails $ s