#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define MOD 1000000007
#define FOR(i,a,b) for (int i = (a);i <= (b);i++)
#define FOD(i,a,b) for (int i = (b);i >= (a);i--)
#define ALL(x) (x).begin(),(x).end()
#define ii pair<ll,ll>
#define iii pair<int,pair<int,int>>
//const int MOD = 998244353;
const int MAXN = 1e5 + 7;
const ll oo = 9e18;
int a[MAXN],n;
vector<ll> v;
bool f[19];
ll ans = -oo;
void check(int id,ll cur){
if (!id){
ans = max(ans,cur);
return ;
}
FOR(i,1,9)if (!f[i]){
f[i] = true;
FOR(j,i + 1,9)if (!f[j]){
f[j] = true;
FOR(k,j + 1,9)if (!f[k]){
f[k] = true;
check(id - 1,cur + v[i] * v[j] * v[k]);
f[k] = false;
}
f[j] = false;
}
f[i] = false;
}
}
void sub1(int mask = n){
int cnt = 0;
FOR(i,1,(1<<mask) - 1)
if (__builtin_popcount(i) == 9){
cnt++;
v.clear();v.push_back(0);
FOR(j,0,mask - 1)if (i >> j & 1)
v.push_back(a[j + 1]);
//check(3,0);
}
cout << cnt;
}
void sub2(){
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
FOR(i,1,n)cin >> a[i];
if (n <= 18)sub1();
else sub2();
return 0^0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZSBzZWNvbmQKI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIEZPUihpLGEsYikgZm9yIChpbnQgaSA9IChhKTtpIDw9IChiKTtpKyspCiNkZWZpbmUgRk9EKGksYSxiKSBmb3IgKGludCBpID0gKGIpO2kgPj0gKGEpO2ktLSkKI2RlZmluZSBBTEwoeCkgKHgpLmJlZ2luKCksKHgpLmVuZCgpCiNkZWZpbmUgaWkgcGFpcjxsbCxsbD4KI2RlZmluZSBpaWkgcGFpcjxpbnQscGFpcjxpbnQsaW50Pj4KLy9jb25zdCBpbnQgTU9EID0gOTk4MjQ0MzUzOwpjb25zdCBpbnQgTUFYTiA9IDFlNSArIDc7CmNvbnN0IGxsIG9vID0gOWUxODsKaW50IGFbTUFYTl0sbjsKdmVjdG9yPGxsPiB2Owpib29sIGZbMTldOwpsbCBhbnMgPSAtb287CnZvaWQgY2hlY2soaW50IGlkLGxsIGN1cil7CiAgICBpZiAoIWlkKXsKICAgICAgICBhbnMgPSBtYXgoYW5zLGN1cik7CiAgICAgICAgcmV0dXJuIDsKICAgIH0KICAgIEZPUihpLDEsOSlpZiAoIWZbaV0pewogICAgICAgIGZbaV0gPSB0cnVlOwogICAgICAgIEZPUihqLGkgKyAxLDkpaWYgKCFmW2pdKXsKICAgICAgICAgICAgZltqXSA9IHRydWU7CiAgICAgICAgICAgIEZPUihrLGogKyAxLDkpaWYgKCFmW2tdKXsKICAgICAgICAgICAgICAgIGZba10gPSB0cnVlOwogICAgICAgICAgICAgICAgY2hlY2soaWQgLSAxLGN1ciArIHZbaV0gKiB2W2pdICogdltrXSk7CiAgICAgICAgICAgICAgICBmW2tdID0gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZltqXSA9IGZhbHNlOwogICAgICAgIH0KICAgICAgICBmW2ldID0gZmFsc2U7CiAgICB9Cn0Kdm9pZCBzdWIxKGludCBtYXNrID0gbil7CglpbnQgY250ID0gMDsKICAgIEZPUihpLDEsKDE8PG1hc2spIC0gMSkKICAgIGlmIChfX2J1aWx0aW5fcG9wY291bnQoaSkgPT0gOSl7CiAgICAJY250Kys7CiAgICAgICAgdi5jbGVhcigpO3YucHVzaF9iYWNrKDApOwogICAgICAgIEZPUihqLDAsbWFzayAtIDEpaWYgKGkgPj4gaiAmIDEpCiAgICAgICAgdi5wdXNoX2JhY2soYVtqICsgMV0pOwogICAgICAgIC8vY2hlY2soMywwKTsKICAgIH0KICAgIGNvdXQgPDwgY250Owp9CnZvaWQgc3ViMigpewoKfQppbnQgbWFpbigpewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKDApOyBjb3V0LnRpZSgwKTsKICAgIGNpbiA+PiBuOwogICAgRk9SKGksMSxuKWNpbiA+PiBhW2ldOwogICAgaWYgKG4gPD0gMTgpc3ViMSgpOwogICAgZWxzZSBzdWIyKCk7CiAgICByZXR1cm4gMF4wOwp9