def valid(arr)
  cnt = 0
  0.upto($t.size-1) do |i| 
    if arr[i] == $t[i]
      cnt += 1
    end
  end
  return cnt
end
s = gets.chomp
$t = gets.chomp
max = 0
0.upto(s.size-$t.size) do |i|
  max = [max, valid(s[i..(i+$t.size-1)])].max
end

puts $t.size - max