fun main(args: Array<String>) {
    val s = readLine()!!
    val t = readLine()!!

    val s1 = s.length
    val t1 = t.length

    var best = 1000000
    (0 .. (s1 - t1)).forEach {skip ->
        val diff = s.drop(skip).zip(t).count { it.first != it.second }
        best = Math.min(best, diff)
    }
    println(best)
}
