ss=gets.chomp.chars
ts=gets.chomp.chars
ns=[]
a=ts.size
0.upto(ss.size-a) do |i|
  ns << ss.slice(i..i+a-1)
end
c=Array.new(ns.size,0)
ns.each_with_index do |n,f|
  0.upto(ts.size) do |i|
    c[f] += 1 unless n[i]==ts[i]
  end
end
p c.min