a=raw_input()b=raw_input()ct=[]s=0fl=0iflen(a)==1and len(b)!=1:fl=1fori in b:ifa==i:print 1else:print 0iflen(b)==1:fl=1fori in a:ifb==i:print 1else:print 0fori in range(len(a)-1):forj in range(len(b)-1):ifa[i]==b[j] and a[i+1]==b[j+1]:s=s+1breakelif a[i]==b[j]:ct.append(s)s=0ct.append(s)ifmax(ct)!=0:print max(ct)+1else:iffl==0:print 0