s = gets.chomp
t = gets.chomp
arr = t.split('')
i = 0
count = 0
while i < s.size - (t.size - 1)
  arr1 = s.slice(i,t.size).split('')
  j = 0
  c = 0
  while j < arr.size
    if arr[j] == arr1[j]
      c += 1
    end
    j+= 1
  end
  # p c
  if count < c
    count = c
  end
  i += 1
end
p t.size-count