io = DATA.eof? ? STDIN : DATA
$s=io.gets.chomp
$t=io.gets.chomp
s_s=$s.size
t_s=$t.size
def check(a,b)
  ar=a.size.times.map{|i|a[i]==b[i]}
  ar.chunk_while{|a,b|a==b}.map{|bools|bools[0]==false ? 0: bools.size}.max
end

max=0
(0..s_s-t_s).each do |i|
  max=[check($s[i,t_s],$t),max].max
end
puts t_s-max
__END__
