#include<bits/stdc++.h>

using namespace std;

struct Complex {
	double a,b;
	Complex(){
		a = b = 0;
	}
	Complex(double a,double b):a(a),b(b) {}
	Complex operator +(const Complex &r) {
		return Complex(a+r.a,b+r.b);
	}
	Complex operator -(const Complex &r) {
		return Complex(a-r.a,b-r.b);
	}
	Complex operator *(const Complex &r) {
		return Complex(a*r.a-b*r.b,a*r.b+b*r.a);
	}
	Complex operator /(const double &r) {
		return Complex(a/r,b/r);
	}
	Complex conj() {
		return Complex(a,-b);
	}
}a[804040],b[804040],w1[804040],w2[804040];
int nn = 1,rev[804040],n,m;
const int mod = 200003;
const double pi = acos(-1);
inline void FFT(Complex *x,Complex *w) {
	register int i,j,k;
	for (i = 1;i < nn; i++)
		if (rev[i] > i)
			swap(x[rev[i]],x[i]);
	Complex t0,t1;
	for (i = 1;i < nn; i <<= 1)
		for (j = 0;j < nn;j += (i<<1))
			for (k = 0;k < i; k++) {
				t0 = x[j|k],t1 = x[i|j|k]*w[i|k];
				x[j|k] = t0+t1,x[i|j|k] = t0-t1;
			}
}
int rg[202020],rgcnt = 0;

inline int quick_pow(int x,int p,int mul=1) {
	for (;p;p>>=1,x=1LL*x*x%mod) if (p&1) mul=1LL*mul*x%mod; return mul;
}
inline int getRoot() {
	for (int i = 2;i < mod-1; i++)
		if ((mod-1)%i == 0)
			rg[++rgcnt] = i;
	for (int i = 2;i < mod; i++) {
		int j;
		for (j = 1;j <= rgcnt; j++)
			if (quick_pow(i,rg[j]) == 1)
				break;
	//	if (j > rgcnt)
	//		cout << i << endl;
	}
	return 0;
}
int pows[202020] = {0},t[202020];
	int aa[202020];
int main() {
	int rt = getRoot();
	rt = 5;
	pows[0] = 1;
	t[1] = 0;
	for (int i = 1;i <= mod-1; i++) {
		pows[i] = pows[i-1]*rt%mod;
		t[pows[i]] = i;
	}
	scanf("%d",&n);
	for (int i = 1;i <= n; i++) {
		scanf("%d",&aa[i]);
		if (aa[i])
		a[t[aa[i]]].a++;
	}
	int N = n;
	n = m = mod-1;
	while (nn <= n+m)
		nn <<= 1;
	int half = nn/2;
	for (int i = 1;i < nn; i++)
		rev[i] = ((rev[i>>1]>>1)|((i&1)?half:0));
	for (int i = 0;i < half; i++)
		w1[i|half] = Complex(cos(pi*i/half),sin(pi*i/half));
	for (int i = half-1;i; i--)
		w1[i] = w1[i<<1];
	for (int i = 0;i < nn; i++)
		w2[i] = w1[i].conj();
	FFT(a,w1);
	for (int i = 0;i < nn; i++)
		a[i] = a[i]*a[i];
	FFT(a,w2);
	long long ans = 0,now = 1;
	for (int i = 0;i <= n+m; i++) {
		ans += now*(long long)(a[i].a/nn+.5);
		now *= rt;
		now %= mod;
	}
	for (int i = 1;i <= n; i++)
		ans -= (long long)aa[i]*aa[i]%mod;
	ans /= 2;
	printf("%lld\n",ans);
	return 0;
}