#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<string>
#include<queue>
#include<map>
using namespace std;

int main() {
	string a, b;
	while (cin >> a >> b) {
		int MAX = 0;
		for (int i = -((int)a.length()) + 1; i < (int)(b.length()); i++) {
			int k = 0;
			for (int j = 0; j < a.length(); j++) {
				if (i + j < 0 || i + j >= b.length() || a[j] != b[i + j])k = 0;
				else k++;
				MAX = max(MAX, k);
			}
		}
		cout << MAX << endl;
	}
}