
object Main extends App {
  
  val sc = new java.util.Scanner(System.in) 
  val s = sc.next().toArray
  val t = sc.next().toArray
  val ans = for (i <- 0 to s.length - t.length) yield {
    (for (j <- 0 until t.length) yield if (s(i+j) == t(j)) 0 else 1).sum
  }
  println(ans.min)
}