s = gets.strip
t = gets.strip

sl = s.length
tl = t.length
sc = s.chars
tc = t.chars

max = 0
(sl - tl).times do |i|
  a = 0
  tl.times do |j|
    a += 1 if sc[i + j] == tc[j]
  end
  max = a if max < a
end

puts tl - max
