#include using namespace std; int main() { int N; cin >> N; vectora(21); for(int i = 0; i < N; i++) { int b;cin>>b;a[b]++; } long long ans1 = 1,ans2 = 1; for(int i = 1; i <= N; i++) { ans1 *= i; for(int j = 1; j <= a[i]; j++) { ans2 *= j; } } cout << ans1/ans2 << endl; }