object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s, t = sc.next()

  val ans = s.toSeq.sliding(t.length).map(ss => ss.zip(t).count{case (a, b) => a != b}).min
  println(ans)
}
