fun main(args: Array<String>) {
	val s = readLine() ?: return
	val t = readLine() ?: return
	
	println(theNumberOfDifference(s, t))
}

fun theNumberOfDifference(baseString: String, partOfString: String) : Int {

	var difference: Int
	var minDifference = partOfString.length
	
	for (i in 0..(baseString.length - partOfString.length)) {
		difference = 0
		for ((index, char) in partOfString.withIndex()) {
			if (char != baseString[i+index]) {
				difference++
			}
		}
		minDifference = minOf(difference, minDifference)
	}
	
	return minDifference
}