object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val S, T = sc.next()
  println {
    S.tails
      .filter(T.length <= _.length)
      .map(_.zip(T).count { case (l, r) => l != r })
      .min
  }
}
