#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

#define int ll

using namespace std;

struct PrimitiveRoot{

	int mod, root; //modulo must be prime
	//call initialization and answer will be in 'root'

	int mult(int x, int y){
		return ((ll) x * (ll) y) % (ll) mod;
	}

	int pw(int x, int y){
		if (y==0) return 1;
		if (y==1) return x%mod;
		if (y%2) return mult(x, pw(x, y-1));
		int R = pw(x, y/2);
		return mult(R, R);
	}

	vector<int> get_primes(int v){
	    vector<int> ans;
	    int uk = 2;
	    while(uk * uk <= v){
	        int was = 0;
	        while(v % uk == 0){
	            v /= uk;
	            was = 1;
	        }
	        if (was) ans.push_back(uk);
	        uk++;
	    }
	    if (v > 1) ans.push_back(v);
	    return ans;
	}

	PrimitiveRoot(int given_mod){
		mod = given_mod;
	    int phi = mod - 1;
	    auto now = get_primes(phi);

	    for (int v = 1; ; v++){
	        bool ok = 1;

	        for (int p : now) if (pw(v, phi / p) == 1){
	            ok = 0;
	            break;
	        }

	        if (ok){
	        	root = v;
	        	return;
	        }
	    }
	}
};


const int mod = 200003;

int bp(int a, int k) {
	if (k == 0) return 1;
	if (k % 2 == 0) {
		int q = bp(a, k >> 1);
		return q * (ll)q % mod;
	} else {
		return bp(a, k - 1) * (ll)a % mod;
	}
}

int step[200007];

class cn {
public:
	db x, y;
	cn(){}
	cn(db xx, db yy): x(xx), y(yy) {}
	cn(db xx): x(xx), y(0) {}
	db real() { return x; }
	void operator /= (double f) { x /= f; y /= f; }
};

cn operator + (cn a, cn b) { return cn(a.x + b.x, a.y + b.y); }
cn operator - (cn a, cn b) { return cn(a.x - b.x, a.y - b.y); }
cn operator * (cn a, cn b) { return cn(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }

class FFT {
public:
	constexpr static db pi = acos(-1.0);
	const static int MAX_SIZE = 1 << 21;

	//#define cn complex<db>

	int n;
	cn a[MAX_SIZE * 2 + 7], b[MAX_SIZE * 2 + 7];

	int getReverse(int a, int k){
		int ans = 0;
		for (int i = 0; i < k; i++) if ((a >> i) & 1) ans ^= (1 << (k - i - 1));
		return ans;
	}

	void fft(cn *a, int type){
		int k = -1;
		for (int i = 0; i < 25; i++) if ((n >> i) & 1){ 
			k = i;
			break;
		}
		for (int i = 0; i < n; i++){
			int j = getReverse(i, k);
			if (i < j) swap(a[i], a[j]);
		}
		for (int len = 2; len <= n; len *= 2){
			cn w(cos(2 * pi / (db)len), sin(2 * pi / (db)len) * type);
			for (int i = 0; i < n; i += len){
				cn g = cn(1, 0);
				for (int j = 0; j < len / 2; j++){
					cn x = a[i + j];
					cn y = a[i + j + len / 2] * g;
					a[i + j] = x + y;
					a[i + j + len / 2] = x - y;
					g = g * w;
				}
			}
		}
		if (type == -1) for (int i = 0; i < n; i++) a[i] /= n; 
	}

	vector<int> mult(vector<int> &w1, vector<int> &w2){
		n = 1;
		while(n < w1.size() + w2.size()) n <<= 1;
		std::copy(w1.begin(), w1.end(), a);
		std::copy(w2.begin(), w2.end(), b);
		std::fill(a + w1.size(), a + n, 0);
		std::fill(b + w2.size(), b + n, 0);
		fft(a, 1);
		fft(b, 1);
		for (int i = 0; i < n; i++) a[i] = a[i] * b[i];
		fft(a, -1);
		vector<int> ans(n);
		for (int i = 0; i < n; i++) ans[i] = floor((db)a[i].real() + 0.5);
		while(ans.size() && ans.back() == 0) ans.pop_back();
		return ans;
	}
} fft;

main(){
#ifdef LOCAL
	freopen("C_input.txt", "r", stdin);
	//freopen("C_output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);

		int root = 2;
		int now = 1;
		set<int> se;
		int ok = 1;
		for (int i = 0; i < mod - 1; ++i) {
			if (se.find(now) != se.end()) {
				ok = 0;
				break;
			}
			se.insert(now);

			step[now] = i;
			now = now * (ll)root % mod;
		}

	ll ans = 0;

	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> mt(mod, 0);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		if (a[i] == 0) continue;
		ans -= a[i] * (ll)a[i] % mod;
		a[i] = step[a[i]];
		//cout << a[i] << endl;
		mt[a[i]]++;
	}

	//cout << ans << endl;

	//cout << endl;

	auto gg = fft.mult(mt, mt);

	for (int i = 0; i < gg.size(); ++i) if (gg[i] > 0) {
		int kek = bp(root, i);
	//	cout << kek << ' ' << gg[i] << endl;
		ans += kek * (ll)gg[i];
	}

	cout << ans / 2;
}


Measured memory_bytes: 54416