main :: IO ()
main = do
    ss <- getLine
    ts <- getLine
    print $ solve ss ts

solve :: String -> String -> Int
solve ss ts = minimum (map (\xs ->
    foldr (\(s, t) acc -> if s == t then acc else acc + 1) 0 $ zip xs ts)
    sss)
      where
        sss = drop (tslen - 1) . snd $ foldr (\_ (n, acc) -> (n + 1, take tslen (drop n ss) : acc)) (0, []) ss
        tslen = length ts
