#include<cstdio>
#include<cstring>

#define int long long

const int N=105,MOD=998244353;

int n;
int w[N];
int f[N][N*N],fac[N],ans;

signed main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%lld",w+i);
		w[0]+=w[i];
	}
	fac[0]=1;
	for(int i=1;i<=n;++i)
		fac[i]=fac[i-1]*i%MOD;
	if(w[0]%2)
		printf("0\n");
	else
	{
		w[0]/=2;
	//	printf("%lld\n",w[0]);
		f[0][0]=1;
		for(int i=1;i<=n;++i)
			for(int j=w[0];j>=0;--j)
				for(int k=1;k<=i;++k)
					if(j>=w[i])
						f[k][j]=(f[k][j]+f[k-1][j-w[i]])%MOD;
		for(int k=1;k<n;++k)
		{
	//		printf("%lld\n",f[k][w[0]]);
			ans=(ans+f[k][w[0]]*fac[k]%MOD*fac[n-k]%MOD)%MOD;
		}
		printf("%lld\n",ans);
	}
	
	return 0;
}
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <bitset>
#include <map>
// #include <bits/stdc++.h>
uintmax_t combination(unsigned int n, unsigned int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}

using namespace std;
typedef long long ll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
constexpr int MAX=510000;

ll fact[MAX], fact_inv[MAX];

// 繰り返し二乗法
ll power(ll a, ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

ll comb(ll n, ll r){
	return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}


/*
std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}
*/


int main(void) {
  int N;
  cin >> N;
  vector<long long> A(N, 0);
  fact[0]=1;

  // input
  for (int i = 0; i < N; i++) cin >> A[i];
  long long ans = 0;

  // 200で割ったあまりにする
  for (int i = 0; i < N; i++) {
    A[i] = A[i] % 200;
  }
  // 種類の数え上げ
  map<long long, long long> mp;
  for (int i = 0; i < N; i++) {
    // 存在する
    if ( auto iter = mp.find(A[i]); iter != end(mp) ) {
      // std::cout << iter->second << std::endl;
      mp[A[i]] += 1;
    } else {
      // std::cout << "not exists" << std::endl;
      mp[A[i]] = 1;
    }
  }

  // さらにまとめる
  map<long long, long long> mp2;
  for (const auto& [key, value] : mp){
    // 存在する
    if ( auto iter = mp2.find(value); iter != end(mp2) ) {
      // std::cout << iter->second << std::endl;
      mp2[value] += 1;
    } else {
      // std::cout << "not exists" << std::endl;
      mp2[value] = 1;
    }
  }

  for (const auto& [key, value] : mp2){
    // std::cout << key << " => " << value << "\n";
  }
    



  for (const auto& [key, value] : mp2){
    if (key > 1) {
      // std::cout << key << " => " << value << "\n";
      // cout << comb(value, 2)[value][2] << endl;
      ans += combination(key, 2) * value;
    }
  }
  cout << ans << endl;
}