# coding: utf-8
s = gets.chomp.chars
t = gets.chomp.chars

str_size = s.size - t.size

diff = t.size
(0..str_size).each { |i|
  now_diff = 0
  new_str = s[i..i+t.size-1] # -> 文字列切り出し
  new_str.each_with_index { |str, index|
    now_diff += 1 if str != t[index]
  }
  diff = now_diff if now_diff < diff
}

p diff







