s=gets.chomp.split("").map(&:to_s)
v=gets.chomp.split("").map(&:to_s)

count=Array.new(v.length){0}
for i in 0..(s.length-v.length-1)
    vv=s[i..i+v.length]
    
    check=0
    for j in 0..vv.length-1
        if vv[j]==v[j]
            check+=1
        end
        
    end
    count[i]=check
  
end
p v.length-count.max