import io.StdIn.{readInt, readLine}
object Main extends App {
  val s = readLine
  val t = readLine

  val result = s.sliding(t.length).map{sub => (t zip sub).count(tsub => tsub._1 != tsub._2)}
                .min
  println(result)
}