
import java.lang.Math.min

fun main(args:Array<String>){
    val strS = readLine()!!
    var strT = readLine()!!
    var ans = strT.length
    for(start in 0..strS.length-strT.length){
        var count = 0
        for(i in 0..strT.length-1){
            if(strT[i] != strS[start + i]){
                count++
            }
        }
        ans = min(ans, count)
    }
    print(ans)
}