function Main(input) {
  input = input.replace(/\n/g, ' ').split(" ");
  var a = input[0];
  var b = input[1];
  var ans = 10000000;
  for(var i=0;i<a.length-(b.length-1);i++){
    var p = 0;
    for(var l=0;l<b.length;l++){
      var t =a.charAt(i+l);
      var s =b.charAt(l);
      if(t!=s)p++;
    }
    if(ans>p)ans=p;
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
