DA-F94-CA1

Time Limit: 2 Seconds    Memory Limit: 65536 KB

Sample Input

1 1 2 2 3 4 4 5 5
2 2 3 3 4 4 5 5 7 7 8

Sample Output

3
8
Submit