s = gets.strip.split('')
t = gets.strip.split('')

min = 9999
0.upto(s.size-t.size) do |i|
  part = s[i...i+t.size]
  count = 0
  part.zip(t) do |a,b|
    if a != b
      count += 1
    end
  end
  min = count if count < min
end

puts min

