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