Given two strings s and t, print the maximum k such that
the prefix of length k of s is equal to the suffix of length k of t.
Input
Input consists of several cases, each one with s and t.
Every string is made up of between 1 and 106 lowercase letters.
Output
For every case, print k.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.
Public test cases
Input
a b
z z
barbacoa acabar
cabar abacar
cabar acabat
cabar acabar
abacad ababa
acad academiacad
Output
0
1
3
0
0
5
3
4
Input
a b
z z
barbacoa acabar
cabar abacar
cabar acabat
cabar acabar
abacad ababa
acad academiacad