#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

template <typename T>
boolean vmin(T& a, T b) {
	return (a > b) ? (a = b, true) : (false);
}
template <typename T>
boolean vmax(T& a, T b) {
	return (a < b) ? (a = b, true) : (false);
}

template <typename T>
T smax(T x) {
	return x;
}
template <typename T, typename ...K>
T smax(T a, const K &...args) {
	return max(a, smax(args...));
}

template <typename T>
T smin(T x) {
	return x;
}
template <typename T, typename ...K>
T smin(T a, const K &...args) {
	return min(a, smin(args...));
}

// debugging lib

#define VN(x) #x
#define Vmsg(x) VN(x) << " = " << (x)
#define printv(x) cerr << VN(x) << " = " << (x);
#define debug(...) fprintf(stderr, __VA_ARGS__);

template <typename A, typename B>
ostream& operator << (ostream& os, const pair<A, B>& z) {
	os << "(" << z.first << ", " << z.second << ')';
	return os;
}
template <typename T>
ostream& operator << (ostream& os, const vector<T>& a) {
	boolean isfirst = true;
	os << "{";
	for (auto z : a) {
		if (!isfirst) {
			os << ", ";
		}
		os << z;
		isfirst = false;
	}
	os << '}';
	return os;
}

#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define ll long long
#define ull unsigned long long

const int inf = (signed) (~0u >> 2);
const ll llf = (signed ll) (~0ull >> 2);

#define pb push_back
#define eb emplace_back
#define fi first
#define sc second

template <typename T>
int vsize(vector<T>& x) {
	return (signed) x.size(); 
}

template <typename T>
int discrete(T* a, int* b, int n) {
    vector<T> v(a + 1, a + n + 1);
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
	for (int i = 1; i <= n; i++) b[i] = lower_bound(v.begin(), v.end(), a[i]) - v.begin() + 1;
	return v.size();
}

mt19937 rng (time(NULL));

int randint(int l, int r) {
	return rng() % (r - l + 1) + l;
}

#define LL __int128

const int N = 524288;
const int bzmax = 20;

int qpow(int a, int p, int Mod) {
	int rt = 1;
	for ( ; p; p >>= 1, a = 1ll * a * a % Mod) {
		if (p & 1) {
			rt = 1ll * rt * a % Mod;
		}
	}
	return rt;
}

template <const int Mod, const int g>
class ntt_t {
	private:
		int gn[bzmax + 4], _gn[bzmax + 4];
	
		void inc(int& x) {
			if (x >= Mod)
				x -= Mod;
		}
		void dec(int& x) {
			if (x < 0)
				x += Mod;
		}
	public:
		
		ntt_t() {
			for (int i = 0; i <= bzmax; i++) {
				gn[i] = qpow(g, (Mod - 1) >> i, Mod);
				_gn[i] = qpow(g, Mod - 1 -((Mod - 1) >> i), Mod);
			}
		}

		void operator () (int* f, int len, int sgn) {
			for (int i = 1, j = len >> 1, k; i < len - 1; i++, j += k) {
				if (i < j)
					swap(f[i], f[j]);
				for (k = len >> 1; k <= j; j -= k, k >>= 1);
			}
			
			int *wn = (sgn > 0) ? (gn + 1) : (_gn + 1), w, a, b;
			for (int l = 2, hl; l <= len; l <<= 1, wn++) {
				hl = l >> 1, w = 1;
				for (int i = 0; i < len; i += l, w = 1) {
					for (int j = 0; j < hl; j++, w = 1ll * w * *wn % Mod) {
						a = f[i + j], b = 1ll * f[i + j + hl] * w % Mod;
						inc(f[i + j] = a + b);
						dec(f[i + j + hl] = a - b);
					}
				}
			}

			if (sgn < 0) {
				int invlen = qpow(len, Mod - 2, Mod);
				for (int i = 0; i < len; i++) {
					f[i] = 1ll * f[i] * invlen % Mod;
				}
			}
		}

		int correct_len(int len) {
			int m = 1;
			for ( ; m <= len; m <<= 1);
			return m;
		}
		
#define g _g
		void convolution(int* f, int* g, int t, int* h) {
			(*this)(f, t, 1);
			(*this)(g, t, 1);
			for (int i = 0; i < t; i++)
				h[i] = 1ll * f[i] * g[i] % Mod;
			(*this)(h, t, -1);
		}
#undef g
};

typedef class Poly : public vector<int> {
	public:
		using vector<int>::vector;

		Poly& fix(int sz) {
			resize(sz);
			return *this;
		}
} Poly;

const int Mod1 = 998244353, Mod2 = 1004535809;
const ll MOD = 1ll * Mod1 * Mod2;

ntt_t<Mod1, 3> NTT1;
ntt_t<Mod2, 3> NTT2;

const int inv1 = qpow(Mod1, Mod2 - 2, Mod2);
const int inv2 = qpow(Mod2 % Mod1, Mod1 - 2, Mod1);

vector<ll> operator * (Poly A, Poly B) {
	int n = A.size(), m = B.size();
	int k = NTT1.correct_len(n + m - 1);
	A.resize(k), B.resize(k);
	Poly A0 = A, B0 = B;
	Poly C1 (k), C2 (k);
	NTT1.convolution(A.data(), B.data(), k, C1.data());
	NTT2.convolution(A0.data(), B0.data(), k, C2.data());
	int r = n + m - 1;
	vector<ll> C (r);
	A.resize(r);
	for (int i = 0; i < r; i++) {
		ll tmp = (1ll * C1[i] * inv2) % Mod1 * Mod2 + (1ll * C2[i] * inv1) % Mod2 * Mod1;
		(tmp >= MOD) && (tmp -= MOD);
		C[i] = tmp;
	}
	return C;
}

const int Mod = 2e5 + 3;

int n;
int ind[Mod];
Poly a (Mod, 0);

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cin >> n;
	int g = 2;
	while (true) {
		bool flg = true;
		fill(ind, ind + Mod, -1);
		for (int i = 0, y = 1; i < Mod - 1; i++, y = 1ll * y * g % Mod) {
			if (ind[y] >= 0) {
				flg = false;
				break;
			}
			ind[y] = i;
		}
		if (flg) {
			break;
		}
	}
	int x;
	long long ans = 0;
	while (n--) {
		cin >> x;
		ans -= 1ll * x * x % Mod;
		if (x) {
			a[ind[x]]++;
		}
	}
	auto b = a * a;
	int pw = 1;
	for (int i = 0; i < (signed) b.size(); i++, pw = 1ll * pw * g % Mod) {
		ans += 1ll * b[i] * pw;
	}
	cout << (ans >> 1) << '\n';
	return 0;
}


Measured memory_bytes: 20128