

private fun naiveSolver(s:String,t:String):Int {
    // ここに書き込む
    val arr_s = s.toCharArray()
    val arr_t = t.toCharArray()
    val kakikaeArr = IntArray(s.length - t.length + 1)
    for (i in kakikaeArr.indices) {
        val sliced = arr_s.sliceArray(0+i until arr_t.size+i)
        var count = 0
        for (j in arr_t.indices) {
            if (arr_t[j] != sliced[j]) {
                count++
            }
        }
        kakikaeArr[i]=count
    }
    return kakikaeArr.min()!!
}

fun main(){
    val s = readLine()!!
    val t = readLine()!!
    print(naiveSolver(s,t))
}