main = do
    s <- getLine
    t <- getLine
    putStrLn$show$solve s t

solve :: String -> String -> Int
solve s t = minimum $ minList s t

minList :: String -> String -> [Int]
minList s t= getList 0 [] s t

getList :: Int -> [Int] -> String -> String -> [Int]
getList i l s t = if i < length s - length t + 1 then getList (i+1) (putMin i l s t) s t else l

putMin :: Int -> [Int] -> String -> String -> [Int]
putMin i l s t = l ++ [getMin i 0 l s t]

getMin :: Int -> Int -> [Int] -> String -> String -> Int
getMin i j l s t = if j < length t then if (s !! (i+j)) /= t !! j then 1 + getMin i (j+1) l s t else 0 + getMin i (j+1) l s t else 0