let s = stdin.ReadLine()
let t = stdin.ReadLine()

let rec solve min num = 
    let l = s.Length - t.Length
    if num = l
        then min
        else
            let mutable count = 0
            let tl = t.Length
            for i in 0 .. (tl - 1) do
                count <- if s.[i + num] <> t.[i] then count + 1 else count
            let m = if min < count then min else count
            let n = num + 1
            solve m n

solve 10000 0
|> printf "%d"