s = gets.chomp
t = gets.chomp
min = t.length
0.upto (s.length - t.length){ |i|
	cnt = 0
	t.length.times{ |j|
		if(s[i+j] != t[j]) then
			cnt += 1
		end
	}
	if(min > cnt) then
		min = cnt
	end
}
p min