S = gets.chomp
T = gets.chomp

#puts S,T

count=T.length
for i in 0..S.length-T.length
  count_tmp=0
  for j in 0..T.length-1
    if(S[i+j]!=T[j])
      count_tmp+=1
    end
  end
  if(count_tmp<count)
    count=count_tmp
  end
end

puts count