class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @s = gets.chomp
    @t = gets.chomp
    @n = s.size
    @m = t.size
  end

  def solve
    ans = 10**15
    0.upto(n-m) do |i|
      cnt = 0
      m.times do |j|
        cnt += 1 if s[i+j] != t[j]
      end
      ans = cnt if ans > cnt
    end
    ans
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end