S = gets
T = gets

ns = S.length
nt = T.length

n_try = ns - nt + 1

i = 0
mm = 0

n_try.times do
  j = 0
  m = 0
  nt.times do
    if S[i+j] == T[j]
      m+=1
    end
    j += 1
  end
  if m > mm
    mm = m
  end
  i += 1
end

puts nt - mm
