# Jubilation

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 32768/32768 K (Java/Others)

## Description

One of the key elements to hold a successful programming contest is maximizing the overall satisfaction degree of all participating teams. Although a team's satisfaction degree is influenced by many factors -- for example, whether this competition is well-organized, and sometimes the weather condition of the place where the competition is held - but among those factors, what usually influences a team's satisfaction degree most is the team's performance in the contest.

Since the performance factor is a matter which the organizing committee cannot control, ask you to simply estimate the overall satisfaction degree of all teams. In particular, through years of experience, the committee asks you to calculate the satisfaction degree of a team using the following estimation steps:

1. If this team has performed in the contest at least as well as it had expected, its satisfaction degree is 3; otherwise
2. If this team's performance is better than its last year's performance, its satisfaction degree is 2; otherwise its satisfaction degree is 1.

(For the sake of simplicity, both the performance of a team and a team's expectation are measured by its place on the rank list.)

This year's and last year's rank lists, along with the expectations of all teams are already given to you. (But the method which we used to find the expectations of the participating teams will remain a secret!) Can you calculate the total satisfaction degree of all teams by the above rules and the data you've been given?

## Input

There are multiple test cases in the input file. Each test case starts with one integer N (3<=N<=1000) on a single line, the number of teams participating in the contest.

The second line of every test case consists of N numbers in the range [1...N] , the i -th number representing the ID of team with i -th place in this year's contest. Similarly, the third line of every test case describes the final rank list of last year's contest. You can assume there will be no ties in the rank lists given to you.

The last line of every test case consists of N numbers in the range [1...N] , the i -th number representing the expectation of the i -th team this year. There's a blank line between two successive test cases. A single line with N = 0 indicates the end of input file.

## Output

For each test case, output one integer on a separate line, the overall satisfaction degree of all teams, in the format as indicated in the sample output.

## Sample Input

5
5 4 1 3 2
3 1 5 2 4
3 5 1 1 2

5
5 4 1 3 2
1 2 4 5 3
5 3 3 5 1

0

## Sample Output

Case 1: 12
Case 2: 12

lcy

## Source

2007 Asia Regional Chengdu