S = gets.chomp
T = gets.chomp
m = T.size
(0 .. S.size - T.size).each do |i|
  c = 0
  (0..T.size).each do |j|
    if T[j]!=S[i+j]
      c += 1 
      break if c > m
    end
  end
  m = c if c < m
end
puts m