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

[for i in 0..s.Length - t.Length ->
    [for j in 1..t.Length do
        if s.[i + j - 1] <> t.[j - 1] then yield 1]]
|> List.map List.sum |> List.min |> printfn "%d"