console.log((args=>{
  const [S,T] = args.trim().split`\n`;
  const sl = S.length, tl = T.length;
  let min = tl;
  for ( let i = 0; i < sl-tl; i++ ) {
    let count = tl;
    for ( let j = 0; j < tl; j++ ) {
      if ( S[i+j] === T[j] ) count--;
    }
    if ( min > count ) min = count;
  }
  return min;
})(require('fs').readFileSync('/dev/stdin','utf8')));
