2192 - 遗忘的密码

Input

第一行一个整数N; 第二行N个整数描述C;N<=30

Output

一个整数表示对于所有可能作为密码的A序列的个数。

Examples

Input

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

Output

1
5
120
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题