/*

Code for problem  by cookiedoth
Generated 09 Aug 2020 at 04.01 PM


   ,##.                   ,==.
 ,#    #.                 \ o ',
#        #     _     _     \    \
#        #    (_)   (_)    /    ; 
 `#    #'                 /   .'  
   `##'                   "=="

^_^
~_^
=_=

*/

#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
#include <random>
#include <cstring>
#include <numeric>
#define ll long long
#define ld long double
#define null NULL
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define debug(a) cerr << #a << " = " << a << endl
#define forn(i, n) for (int i = 0; i < n; ++i)
#define sz(a) (int)a.size()

using namespace std;

template<class T> int chkmax(T &a, T b) {
	if (b > a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class T> int chkmin(T &a, T b) {
	if (b < a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class iterator> void output(iterator begin, iterator end, ostream& out = cerr) {
	while (begin != end) {
		out << (*begin) << " ";
		begin++;
	}
	out << endl;
}

template<class T> void output(T x, ostream& out = cerr) {
	output(x.begin(), x.end(), out);
}

void fast_io() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

const int MOD = 2e5 + 3;

int mul(int a, int b) {
	return (1LL * a * b) % MOD;
}

int root, used[MOD];

void find_root() {
	for (int r = 2; r < MOD; ++r) {
		int x = 1, ok = 1;
		for (int it = 0; it < MOD - 1; ++it) {
			if (used[x] == r) {
				ok = 0;
				break;
			}
			used[x] = r;
			x = (x * r) % MOD;
		}
		if (ok) {
			root = r;
			break;
		}
	}
	// cerr << "root = " << root << endl;
}

int order[MOD], _order[MOD];

void build_order() {
	order[0] = 1;
	_order[1] = 0;
	for (int i = 1; i < MOD - 1; ++i) {
		order[i] = mul(order[i - 1], root);
		_order[order[i]] = i;
	}
}

vector<ll> poly;
ll ans = 0;

void build_poly() {
	poly.resize(MOD - 1);
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		ans -= mul(x, x);
		if (x == 0) {
			continue;
		}
		poly[_order[x]]++;
		// cerr << "add " << _order[x] << endl;
	}
}


namespace emaxx_fft {
	typedef complex<ld> base;
	const ld PI = acosl(-1);
 
	void fft (vector<base> & a, bool invert) {
		int n = (int) a.size();
	 
		for (int i=1, j=0; i<n; ++i) {
			int bit = n >> 1;
			for (; j>=bit; bit>>=1)
				j -= bit;
			j += bit;
			if (i < j)
				swap (a[i], a[j]);
		}
	 
		for (int len=2; len<=n; len<<=1) {
			ld ang = 2*PI/len * (invert ? -1 : 1);
			base wlen (cos(ang), sin(ang));
			for (int i=0; i<n; i+=len) {
				base w (1);
				for (int j=0; j<len/2; ++j) {
					base u = a[i+j],  v = a[i+j+len/2] * w;
					a[i+j] = u + v;
					a[i+j+len/2] = u - v;
					w *= wlen;
				}
			}
		}
		if (invert)
			for (int i=0; i<n; ++i)
				a[i] /= n;
	}

	void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
		vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
		size_t n = 1;
		while (n < max (a.size(), b.size()))  n <<= 1;
		n <<= 1;
		fa.resize (n),  fb.resize (n);
	 
		fft (fa, false),  fft (fb, false);
		for (size_t i=0; i<n; ++i)
			fa[i] *= fb[i];
		fft (fa, true);
	 
		res.resize (n);
		for (size_t i=0; i<n; ++i)
			res[i] = (ll)(fa[i].real() + 0.5);
	}
}

int power(int a, int deg) {
	int res = 1;
	for (; deg; a = mul(a, a), deg >>= 1) {
		if (deg & 1) {
			res = mul(res, a);
		}
	}
	return res;
}

void solve() {
	vector<ll> poly2;
	emaxx_fft::multiply(poly, poly, poly2);
	for (int i = 0; i < poly2.size(); ++i) {
		if (poly2[i]) {
			// cerr << i << " " << poly2[i] << endl;
			ans += (ll)poly2[i] * (ll)power(root, i);
		}
	}
	ans /= 2;
	cout << ans << '\n';
}

signed main() {
	fast_io();
	find_root();
	build_order();
	build_poly();
	solve();
}


Measured memory_bytes: 46280