read s
s=(`echo $s|fold -1`)
read t
t=(`echo $t|fold -1`)
ans=1010
for((i=0;i<=${#s[@]}-${#t[@]};i++));do
	c=0
	for((j=0;j<${#t[@]};j++));do
		if [ ${s[i+j]} != ${t[j]} ];then
			c=$[c+1]
		fi
	done
	if [ $ans -gt $c ];then
		ans=$c
	fi
done
echo $ans
