S = gets.chomp
T = gets.chomp

max = 0
(0..(S.size - T.size)).each do |n|
  str = S[n..(T.size-1 + n)]
  same_count = str.split("").filter.with_index do |s, i|
    s == T[i]
  end.size
  max = same_count if max < same_count
end
puts T.size - max