s = gets.chomp
t = gets.chomp
t_length = t.length

try_count = s.length - t_length

max = 0
try_count.times do 
  target = s.slice(0, t_length)
  max = target.zip(t).map{|a,b| a == b ? 1 : 0 }.sum
end

put max