Three shipping manifests each encode their scan order as a string of lowercase letters. To find the largest ordering common to all three, compute the length of the longest common subsequence shared by all three strings a, b, and c (characters appearing in all three in the same relative order, not necessarily contiguously).
Input format
Line 1: the first manifest string a.
Line 2: the second manifest string b.
Line 3: the third manifest string c.
Output format
A single integer: the length of the longest common subsequence of all three strings.
Constraints
- 1 <= length of each string <= 40
- All strings consist of lowercase English letters only.