import java.util.Scanner; public class Main { public static void main(String[] args) { int max =0; Scanner scanner = new Scanner(System.in); String str1 = scanner.nextLine(); String str2 = scanner.nextLine(); int [][] num = new int[str1.length()+1][str2.length()+1]; for(int i = 1;i <= str1.length();i++){ for(int j =1;j<=str2.length();j++){ if(str1.charAt(i-1)==str2.charAt(j-1)){ num[i][j] = num[i-1][j-1] +1; if(num[i][j]>=max) max = num[i][j]; }else num[i][j] = 0; } } System.out.println(max); } }