diff :: String -> String -> Int
diff xs xt = length [x | x <- zip xs xt, fst x /= snd x]

slice :: Int -> Int -> String -> String
slice start length str = take length $ drop start str

main :: IO ()
main = do
    s <- getLine
    t <- getLine
    let n = length s - length t
    let r = minimum $ map (diff t) [slice x (x + length t) s | x <- [0..n]] 
    (putStrLn . show) r
