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