import qualified Data.ByteString.Char8 as B

main = do
    s <- B.getLine
    t <- B.getLine
    print $ answer s t

answer :: B.ByteString -> B.ByteString -> Int
answer s t = minimum $ map (count . (,) t) . take (B.length s - B.length t + 1) $ B.tails s 

count :: (B.ByteString,B.ByteString) -> Int
count (t,s) = if t == B.empty || s == B.empty
    then 0
    else if B.head s == B.head t
        then count (B.tail t, B.tail s)
        else 1 + count (B.tail t, B.tail s)