# ?????¬??????)?§£??¬?????????
# see: http://d.hatena.ne.jp/jetbead/20110724/1311526610

lines = STDIN.read.split

lines.each_slice(2) do |a, b|
  puts "wrong answer"
  exit
  s, t = [a, b].sort { |x, y| y.size - x.size }.map(&:chomp)
  f = "-" * (t.size-1)
  s = f + s

  ans = 0
  s.size.times do |offset|
    lens = [0]
    t.chars.each_with_index do |tch, ti|
      if tch == s[offset+ti]
        lens[-1] += 1
      else
        lens << 0 unless lens[-1] == 0
      end
    end
    ans = [ans, lens.max].max
  end

  puts ans
end