#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef complex<double> cd;
const int maxn = 5e5 + 10;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = 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) {
        double ang = 2 * PI / len * (invert ? -1 : 1);
        cd wlen(cos(ang), sin(ang));
        for (int i = 0; i < n; i += len) {
            cd w(1);
            for (int j = 0; j < len / 2; j++) {
                cd 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 (cd & x : a)
            x /= n;
    }
}
 
vector<ll> multiply(vector<int> const& a, vector<int> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < a.size() + b.size()) 
        n <<= 1;
    fa.resize(n);
    fb.resize(n);
 
    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);
 
    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

int b[maxn], g[maxn], pw[maxn];

int main(){
	ios_base::sync_with_stdio(false);
	int p = 200003;
	int now = 1;
	for (int i = 0; i <= p-2; i++){
		g[now] = i;
		pw[i] = now;
		now = 2*now%p;
	}
	int n;
	cin >> n;
	vector<int> cnt(p-1);
	for (int i = 1; i <= n; i++){
		int x;
		cin >> x;
		if (x == 0)
			continue;
		cnt[g[x]] ++;
		b[g[x]+g[x]] ++;
	}
	ll answer = 0;
	vector<ll> a = multiply(cnt, cnt);
	for (int i = 0; i <= 2*p-2; i++)
		answer += 1LL*(a[i]-b[i])/2*pw[i%(p-1)];
	cout << answer << endl;
}
