#include <bits/stdc++.h>
using namespace std;
//{
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define all(v) (v).begin(),(v).end()
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)


#define PII pair<int,int>
#define st first
#define nd second
#define pb push_back
#define lint long long int
#define VI vector<int>

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
};
//{
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);} 
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}
#define jeb() fflush(stdout);
//}

#define CD complex<double>


const int max_n = 8e5+15;
const double eps = 1e-8;
CD roots[max_n];
CD t1[max_n], t2[max_n]; 

int N;
int n1, n2; // INPUT 
VI A, B;
lint ANS[max_n];

void FFT(CD t[]) {
	FOR(i,0,N) {
		int j = 0;
		for (int k=1; k<N; k<<=1, j<<=1) if(k&i) j++;
		j>>=1;
		if(i<j) swap(t[i], t[j]);
	}
	int step = 1, n_step = 0;
	while ((1<<n_step)<N) n_step++;
	for (int step=1; step<N; step<<=1) {
		--n_step;
		for(int i = 0; i<N; i+=2*step) FOR(j,0,step) {
			CD u = t[i+j], v = t[i+j+step];
			t[i+j] = u + v*roots[j<<n_step];
			t[i+j+step] = u-v*roots[j<<n_step];
		}
	}
}

void conv() {
	N = 1;
	while(N<n1 || N<n2) N<<=1;
	N<<=1;
	FOR(i,0,N) {
		t1[i] = CD(0.0,0.0);
		t2[i] = CD(0.0,0.0);
		roots[i] = CD(cos(2*M_PI*i/N), -sin(2*M_PI*i/N));
	}
	FOR(i,0,n1) t1[i] = CD(A[i],0.0);
	FOR(i,0,n2) t2[i] = CD(B[i],0.0);
	FFT(t1); FFT(t2);
	double s = 1.0/N;
	FOR(i,0,N) {
		t1[i] *= t2[i]*s;
		roots[i] = CD(real(roots[i]), -imag(roots[i]));
	}
	FFT(t1);
	
	FOR(i,0,N) {
		ANS[i] = ((lint) (real(t1[i]+0.5)));
		roots[i] = CD(real(roots[i]), -imag(roots[i]));
	}
}

int p = 200003;
int gen = 2;
int p2[200003];
int trans[200003];
int cnt[200003];

int main() {
	make(n);
	makev(v, n);
	sort(all(v));
	p2[0] = 1;
	FOR(i,1,p) p2[i] = (p2[i-1]+p2[i-1])%p;
	FOR(i,1,p) trans[i] = -1;
	FOR(i,0,p-1) trans[p2[i]] = i;
	FOR(i,0,n) {
		if (v[i] == 0) continue;
		cnt[trans[v[i]]]++;
	}
	FOR(i,0,p) {
		A.pb(cnt[i]), B.pb(cnt[i]);
		//if (cnt[i] != 0) debug() << imie(i) imie(cnt[i]);
	}
	n1 = n2 = p;
	conv();
	lint ans = 0;
	//debug() << "AAA";
	FOR(i,0,n1+n2) {
		//if (ANS[i] != 0) debug() << imie(i) imie(ANS[i]);
		ans += (ANS[i]*1LL*p2[i%(p-1)]);
	}
	FOR(i,0,n) {
		ans -= (v[i]*1LL*v[i])%p;
	}
	printf("%lld\n", ans/2);
}



Measured memory_bytes: 37264