#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long int int64;


typedef complex<long double> cd;
typedef long long ll;

const double PI = 4. * atan(1.);

//const int POW = 10;
const int POW = 19;
const int L = 1 << POW;

int n;
cd A[L], B[L], C[L];
ll c[L];
int rev[L];
cd w[L];

ll myRound(double x)
{
	if (x >= 0)
		return (ll)(x + 0.49);
	else
		return (ll)(x - 0.49);
}

void init()
{
	for (int i = 0; i < L; i++)
		w[i] = cd(cos(2. * PI * i / L), sin(2. * PI * i / L));

	rev[0] = 0;
	for (int mask = 1; mask < L; mask++)
	{
		int k = 0;
		while((mask & (1 << k)) == 0) k++;
		rev[mask] = rev[mask ^ (1 << k)] | (1 << (POW - 1 - k));
	}

	return;
}

cd P[2][L];
void FFT(cd* F)
{
	for (int i = 0; i < L; i++)
		P[0][rev[i]] = F[i];
	int t = 0, nt = 1;
	for (int lvl = 0; lvl < POW; lvl++)
	{
		int len = 1 << lvl;
		for (int st = 0; st < L; st += (len << 1))
		{
			for (int i = 0; i < len; i++)
			{
				cd x = P[t][st + i];
				cd y = P[t][st + len + i] * w[i << (POW - 1 - lvl)];
				P[nt][st + i] = x + y;
				P[nt][st + len + i] = x - y;
			}
		}
		swap(t, nt);
	}
	for (int i = 0; i < L; i++)
		F[i] = P[t][i];
	return;
}
/*
int main()
{
	init();

	scanf("%d", &n);
	for (int i = 0; i <= n; i++)
	{
		ll x;
		scanf("%lld", &x);
		A[i] = cd(x, 0.);
	}
	scanf("%d", &n);
	for (int i = 0; i <= n; i++)
	{
		ll x;
		scanf("%lld", &x);
		B[i] = cd(x, 0.);
	}
	FFT(A);
	FFT(B);
	for (int i = 0; i < L; i++)
		C[i] = A[i] * B[i];
	FFT(C);
	for (int i = 0; i < L; i++)
		c[i] = myRound(C[i].real() / L);
	reverse(c + 1, c + L);
	n = L - 1;
	while(n > 0 && c[n] == 0) n--;
	printf("%d\n", n);
	for (int i = 0; i <= n; i++)
		printf("%lld ", c[i]);
	printf("\n");

	return 0;
}
*/


const int PP = 200003;

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

bool isRoot(int x)
{
    int cur = x;
    int deg = 1;
    while (cur != 1)
    {
        deg++;
        cur = mul(cur, x);
    }
    return deg == PP - 1;
}

int deg[PP], lg[PP];

void _init()
{
    int root = 2;
    while (!isRoot(root))
        root++;
    eprintf("root = %d\n", root);

    deg[0] = 1;
    for (int i = 0; i + 1 < PP; i++)
        deg[i + 1] = mul(deg[i], root);

    for (int i = 0; i < PP - 1; i++)
        lg[deg[i]] = i;
}


const int N = (int) 2e5 + 100;
int a[N];


int main(int,  char **)
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

    init();
    _init();

    int nn;
    scanf("%d", &nn);
    for (int i = 0; i < nn; i++)
        scanf("%d", &a[i]);

    long long subAns = 0;
    long long answer = 0;

    for (int i = 0; i < nn; i++)
    {
        if (a[i] == 0)
            continue;
        eprintf("a[i] = %d, lg = %d\n", a[i], lg[a[i]]);
        A[lg[a[i]]] += 1;
        subAns += mul(a[i], a[i]);
    }
    eprintf("!!\n");

    FFT(A);
    for (int i = 0; i < L; i++)
        A[i] *= A[i];
    FFT(A);

    reverse(A + 1, A + L);

    for (int i = 0; i < L; i++)
        answer += deg[i % (PP - 1)] * myRound(A[i].real() / L);

    answer -= subAns;
    answer /= 2;

    printf("%lld\n", answer);



	return 0;
}




Measured memory_bytes: 74116