import kotlin.math.*
import java.util.*
import java.io.*
var ans:Int = 0
var temptemp:Int = 0
var temp:Int = 0
fun main() {
    val S = readLine()!!
    val T = readLine()!!
    val slength:Int = S.length
    val tlength:Int = T.length
    for(i in 0..slength-tlength){
        for(j in 0..tlength-1){
            if(S[i+j] == T[j]){
                temp++
            }
        }
        if(temptemp < temp){
            temptemp = temp
        }
        temp = 0
    }
    ans = tlength-temptemp
    println(ans)
}