import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  [s,t] <- lines <$> getContents
  print $ minimum $ map (length . filter (==False)) $ checkMatch s t

checkMatch [] _ = []
checkMatch s@(x:xs) t = do
  if length s >= length t
    then do
      zipWith (==) s t : checkMatch xs t
    else []