fun main() {
    val s = readLine()!!
    val t = readLine()!!
    var min = t.length

    for (i in 0..(s.length - t.length)) {
        val ss = s.substring(i, i + t.length)
        val count = ss.chunked(1).mapIndexed{j, str ->
            if(str != t.substring(j, j+1)){
                1
            }else{
                0
            }
        }.sum()
        min = if(count < min) count else min
    }
    println(min)
}