#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

template<int mod>
struct ModInt{
	int x;
	ModInt () : x(0) {}
	ModInt (int64_t x) : x(x >= 0 ? x % mod : (mod - -x % mod) % mod) {}
	ModInt &operator += (const ModInt &p){
		if ((x += p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator -= (const ModInt &p) {
		if ((x += mod - p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator *= (const ModInt &p) {
		x = (int64_t) x * p.x % mod;
		return *this;
	}
	ModInt &operator /= (const ModInt &p) {
		*this *= p.inverse();
		return *this;
	}
	ModInt &operator ^= (int64_t p) {
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator - () const { return ModInt(-x); }
	ModInt operator + (const ModInt &p) const { return ModInt(*this) += p; }
	ModInt operator - (const ModInt &p) const { return ModInt(*this) -= p; }
	ModInt operator * (const ModInt &p) const { return ModInt(*this) *= p; }
	ModInt operator / (const ModInt &p) const { return ModInt(*this) /= p; }
	ModInt operator ^ (int64_t p) const { return ModInt(*this) ^= p; }
	bool operator == (const ModInt &p) const { return x == p.x; }
	bool operator != (const ModInt &p) const { return x != p.x; }
	explicit operator int() const { return x; }
	ModInt &operator = (const int p) { x = p; return *this;}
	ModInt inverse() const {
		int a = x, b = mod, u = 1, v = 0, t;
		while (b > 0) {
			t = a / b;
			a -= t * b;
			std::swap(a, b);
			u -= t * v;
			std::swap(u, v);
		}
		return ModInt(u);
	}
	friend std::ostream & operator << (std::ostream &stream, const ModInt<mod> &p) {
		return stream << p.x;
	}
	friend std::istream & operator >> (std::istream &stream, ModInt<mod> &a) {
		int64_t x;
		stream >> x;
		a = ModInt<mod>(x);
		return stream;
	}
};
// typedef ModInt<1000000007> mint;

template<int mod> struct MComb {
	using mint = ModInt<mod>;
	std::vector<mint> fact;
	std::vector<mint> inv;
	MComb (int n) { // O(n + log(mod))
		fact = std::vector<mint>(n + 1, 1);
		for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * mint(i);
		inv.resize(n + 1);
		inv[n] = fact[n] ^ (mod - 2);
		for (int i = n; i--; ) inv[i] = inv[i + 1] * mint(i + 1);
	}
	mint ncr(int n, int r) {
		return fact[n] * inv[r] * inv[n - r];
	}
	mint npr(int n, int r) {
		return fact[n] * inv[n - r];
	}
	mint nhr(int n, int r) {
		assert(n + r - 1 < (int) fact.size());
		return ncr(n + r - 1, r);
	}
};

// only with NTT-friendly mods
template<int mod> struct NTT { // mint version
	using mint = ModInt<mod>;
	int get_mod() { return mod; }
	static constexpr std::pair<int, int> proot_map[] = {
		{469762049, 3}, // 2^26
		{998244353, 3}, // 2^23
		{897581057, 3},
		{645922817, 3},
		{880803841, 26},
		{1004535809, 3}, // 2^21
		{1012924417, 5}
	};
	static constexpr int proot_map_size = sizeof(proot_map) / sizeof(*proot_map);
	static constexpr int get_proot(int index = 0) {
		return index == proot_map_size ? throw 0 :
			proot_map[index].first == mod ? proot_map[index].second : get_proot(index + 1);
	}
	static constexpr int proot = get_proot();
	void ntt(std::vector<mint> &a, bool inverse) const {
		int n = a.size();
		assert((n & -n) == n);
		mint h = mint(proot) ^ ((mod - 1) / n);
		if (inverse) h = h.inverse();
		
		for (int i = 0, j = 1; j < n - 1; j++) {
			for (int k = n >> 1; k > (i ^= k); k >>= 1);
			if (j < i) std::swap(a[i], a[j]);
		}
		for (int i = 1; i < n; i <<= 1) {
			mint base = h ^ (n / i / 2);
			mint w = 1;
			
			std::vector<mint> ws(i);
			for (int j = 0; j < i; j++) ws[j] = w, w *= base;
			
			for (int j = 0; j < n; j += i << 1) {
				for (int k = 0; k < i; k++) {
					mint u = a[k + j];
					mint d = a[k + j + i] * ws[k];
					a[k + j] = u + d;
					a[k + j + i] = u - d;
				}
			}
		}
		if (inverse) {
			mint ninv = mint(a.size()).inverse();
			for (auto &i : a) i *= ninv;
		}
	}
	std::vector<mint> convolve_self(std::vector<mint> a) const {
		if (!a.size()) return {};
		size_t n_ = a.size();
		size_t size = 1;
		for (; size < n_ + n_; size <<= 1);
		a.resize(size);
		ntt(a, false);
		for (auto &i : a) i *= i;
		ntt(a, true);
		a.resize(n_ + n_ - 1);
		return a;
	}
	std::vector<mint> convolve(const std::vector<mint> &a_, const std::vector<mint> &b_) const {
		if (!a_.size() || !b_.size()) return {};
		if (&a_ == &b_) return convolve_self(a_);
		std::vector<mint> a = a_, b = b_;
		size_t size = 1;
		for (; size < a_.size() + b_.size(); size <<= 1);
		a.resize(size);
		b.resize(size);
		ntt(a, false);
		ntt(b, false);
		for (size_t i = 0; i < size; i++) a[i] *= b[i];
		ntt(a, true);
		a.resize(a_.size() + b_.size() - 1);
		return a;
	}
};

constexpr int p = 200003;
constexpr int gen = 2;

template<int mod0, int mod1> std::vector<int64_t> garner(const std::vector<ModInt<mod0> > &r0, const std::vector<ModInt<mod1> > &r1) {
	using mint0 = ModInt<mod0>;
	using mint1 = ModInt<mod1>;
	
	int n = r0.size();
	mint1 inv1 = mint1(mod0).inverse();
	std::vector<int64_t> res(n);
	for (int i = 0; i < n; i++) {
		int64_t cur = r0[i].x;
		mint1 diff0 = r1[i].x - cur;
		cur += (int64_t) mod0 * (diff0 * inv1).x;
		res[i] = cur;
	}
	return res;
}

template<int mod> std::vector<ModInt<mod> > mconvolve(const std::vector<int> &a_) {
	using mint = ModInt<mod>;
	int n = a_.size();
	assert(n == p);
	std::vector<mint> a(n);
	int cur = 1;
	for (int i = 0; i + 1 < n; i++) {
		a[i] = a_[cur];
		cur = (int64_t) cur * gen % p;
	}
	std::vector<int> c(2 * p);
	cur = 1;
	for(int i = 0; i < 2 * p; i++){
		c[i] = cur;
		cur = (int64_t) cur * gen % p;
	}
	
	NTT<mod> ntt;
	auto tmp = ntt.convolve(a, a);
	std::vector<mint> res(n);
	for (int i = 0; i < (int) tmp.size(); i++) res[c[i]] += tmp[i];
	return res;
}

int main() {
	int n = ri();
	int a[n];
	std::vector<int> t(p);
	for (int i = 0; i < n; i++) {
		a[i] = ri() % p;
		if (a[i]) t[a[i]]++;
	}
	auto r0 = mconvolve<998244353>(t);
	auto r1 = mconvolve<469762049>(t);
	auto tmp = garner(r0, r1);
	for (auto i : a) tmp[(int64_t) i * i % p]--;
	for (auto &i : tmp) i /= 2;
	
	int64_t res = 0;
	for (int i = 0; i < p; i++) res += (int64_t) i * tmp[i];
	printf("%" PRId64 "\n", res);
	return 0;
}

Measured memory_bytes: 11804