Ferries Wheel

Accepts: 119
Submissions: 1013
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
Problem Description
The Ferries Wheel is a circle,rounded by many cable cars,and the cars are numbered $1,2,3...K-1,K$ in order.Every cable car has a unique value and $A[i-1] < A[i] < A[i+1] (1
Input
There are many test cases. For each case,the first line is a integer $N(1<=N<=100)$ means Misaki has invited $N$ friends,and the second line contains $N$ integers $val1,val2,...valN$, the $val[i]$ means the ${i}^{th}$ friend's cable car's value. $(0<= val[i] <=$ INT_MAX). The INT_MAX is $2147483647$.
Output
For each test case, first output Case #X: ,then output the answer, if there are only one cable car, print "-1";
Sample Input
3
1 2 3
5
1 2 3 5 7
6
2 3 1 2 7 5
Sample Output
Case #1: 1
Case #2: 2
Case #3: 3
Hint
In the third sample, the order of cable cars is {{1},{2}, {3}, {5}, {7}} after they enter cable car,but the 2nd cable car has 2 friends,so the answer is 3.