import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    s <- getLine
    t <- getLine
    let ans = minimum . map (check t) . take (length s - length t + 1) $ tails s
    print ans

check t s = length . filter not $ zipWith (==) t s