#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<iomanip>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
#define all(v) (v).begin(), (v).end()
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline LL fastpo(LL x, LL n, LL mod) {
	LL res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}
LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
	fwrite(buf, 1, _bl, stdout);
	_bl = 0;
}
__inline void _putchar(char c) {
	if(_bl == _B) flush();
	buf[_bl++] = c;
}
inline void print(LL x, char c) {
	static char tmp[20];
	int l = 0;
	if(!x) tmp[l++] = '0';
	else {
		while(x) {
			tmp[l++] = x % 10 + '0';
			x /= 10;
		}
	}
	for(int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
	_putchar(c);
}
const int P = 200003;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

const double PI = acos(-1);
typedef complex<double> Complex;
const int N = 524288, L = 15, MASK = (1 << L) - 1;
Complex w[N];
void FFTInit() {
	for (int i = 0; i < N; ++i)
		w[i] = Complex(cos(2 * i * PI / N), sin(2 * i * PI / N));
}
void FFT(Complex p[], int n) {
	for (int i = 1, j = 0; i < n - 1; ++i) {
		for (int s = n; j ^= s >>= 1, ~j & s;);
		if (i < j) swap(p[i], p[j]);
	}
	for (int d = 0; (1 << d) < n; ++d) {
		int m = 1 << d, m2 = m * 2, rm = n >> (d + 1);
		for (int i = 0; i < n; i += m2) {
			for (int j = 0; j < m; ++j) {
				Complex &p1 = p[i + j + m], &p2 = p[i + j];
				Complex t = w[rm * j] * p1;
				p1 = p2 - t, p2 = p2 + t;
			} } }
}
Complex A[N], B[N], C[N], D[N];
LL a[N];
int lg[P];
void mul(LL a[N], LL b[N]) {
	for (int i = 0; i < N; ++i) {
		A[i] = Complex(a[i] >> L, a[i] & MASK);
		B[i] = Complex(b[i] >> L, b[i] & MASK);
	}
	FFT(A, N), FFT(B, N);
	for (int i = 0; i < N; ++i) {
		int j = (N - i) % N;
		Complex da = (A[i] - conj(A[j])) * Complex(0, -0.5),
				db = (A[i] + conj(A[j])) * Complex(0.5, 0),
				dc = (B[i] - conj(B[j])) * Complex(0, -0.5),
				dd = (B[i] + conj(B[j])) * Complex(0.5, 0);
		C[j] = da * dd + da * dc * Complex(0, 1);
		D[j] = db * dd + db * dc * Complex(0, 1);
	}
	FFT(C, N), FFT(D, N);
	for (int i = 0; i < N; ++i) {
		long long da = (long long)(C[i].imag() / N + 0.5),
				  db = (long long)(C[i].real() / N + 0.5),
				  dc = (long long)(D[i].imag() / N + 0.5),
				  dd = (long long)(D[i].real() / N + 0.5);
		a[i] = ((dd << (L * 2)) + ((db + dc) << L) + da);
	}
}

int main() {
	FFTInit();
	for(int i = 2; i < P; i++) {
		memset(lg, -1, sizeof(lg));
		int cur = 1;
		bool flag = true;
		for(int j = 0; j < P - 1; j++) {
			if(lg[cur] != -1) {
				flag = false;
				break;
			}else {
				lg[cur] = j;
				cur = (LL)cur * i % P;
			}
		}
		//cout << i << endl;
		//if(flag) cout << i << endl;
		if(flag) break;
	}
	int n;
	scanf("%d", &n);
	LL ans = 0;
	for(int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		if(x) {
			a[lg[x]]++;
		}
		ans = (ans - (LL)x * x % P);
	}
	mul(a, a);
	//cout << ans << endl;
	for(int i = P - 1; i < N; i++) {
		a[i % (P - 1)] += a[i];
	}
	for(int i = 1; i < P; i++) {
		ans = (ans + (LL)i * a[lg[i]]);
	}
	cout << ans / 2  << endl;
}






Measured memory_bytes: 49888