'use strict'
function main(input) {
  input = input.split('\n')
  const S = input[0]
  const T = input[1]

  let res = T.length
  let count
  for(let i = 0; i < S.length - T.length; i++) {
    count = 0
    for(let j = 0; j < T.length; j++) {
      if(S[i+j] != T[j]) {
        count++
      }
    }
    if(count < res) {
      res = count
    }
  }

  console.log(res)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))