read s
read t
ls=${#s}
lt=${#t}
min=$lt
for i in `seq 0 $((ls-lt))`
do
    ss=${s:i:lt}
    c=0
    for j in `seq 0 $((lt-1))`
    do
        if [ ${ss:j:1} != ${t:j:1} ]
        then
            c=$((c+1))
            if((c>=min))
            then
                break
            fi
        fi
    done
    min=$((min<c?min:c))
done
echo $min
