read s
read t
ls=${#s}
lt=${#t}
min=$lt
echo $t | fold -1 | nl > f2
for i in `seq 0 $((ls-lt))`
do
    echo ${s:i:lt} | fold -1 | nl > f1
    c=`diff --inhibit-hunk-merge f1 f2 | grep '>' | wc -l`
    min=$((min<c?min:c))
done
echo $min