s = gets.split("")
t = gets.split("")
n = 0
m = 0
cnt = 0
res = []

while n <= (s.length - t.length) do
  t.length.times do
    if s[n+m] == t[m]
      cnt += 1
    end
    m += 1
  end
  n += 1
  m = 0
  res << cnt
  cnt = 0
end

puts t - res.max
