s = gets
t = gets

min = t.size

(s.size - t.size + 1).times do |i|
  a = s.slice(i, t.size - 1).chars
  b = t.chars
  count = 0

  a.zip(b).each do |c, d|
    count += 1 if c != d
  end

  min = count if min > count
end

puts min
