Three sequences#1765

Three sequences

1 second
128 megabytes
Very easy

Three sequences of integers are given. Find the length of their longest common subsequence.

Input

Contains the description of three sequences. Each sequence is given in two lines. The first line contains the length of the sequence (1 \leq n \leq 100), and the second line contains its elements (-bit integers).

Output

Print the length of the longest common subsequence.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading