#ifdef LOCAL
//#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

mt19937 mt(736);

const int mod = int(2e5) + 3;

void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}

void sub(int &a, int b)
{
	a -= b;
	if (a < 0)
		a += mod;
}

int mult(int a, int b)
{
	return (ll) a * b % mod;
}

int find_generator()
{
	for (int g = 2; g < mod; g++)
	{
		int cur = 1;
		bool ok = true;

		for (int i = 1; i <= mod - 2 && ok; i++)
		{
			cur = mult(cur, g);
			ok &= (cur != 1);
		}

		if (ok)
			return g;
	}

	assert(false);
	return -1;
}

int up(const int n)
{
	int ans = 1;
	while (ans < n)
		ans *= 2;
	return ans;
}

using base_type = long double;
const base_type pi = acosl(-1);
using base = complex<base_type>;

void fft(vector<base> &a, const bool inv)
{
	const int n = int(a.size());
	for (int i = 1, j = 0; i < n; i++)
	{
		int bit = (n >> 1);
		while (j & bit)
		{
			j ^= bit;
			bit >>= 1;
		}

		j ^= bit;

		if (i < j)
			swap(a[i], a[j]);
	}

	for (int len = 1; len < n; len *= 2)
	{
		vector<base> w(len);
		const base_type ang = (2 * pi) / (2 * len);

		for (int i = 0; i < len; i++)
			w[i] = base(cosl(ang * i), sinl(ang * i));

		for (int i = 0; i < n; i += 2 * len)
			for (int j = 0; j < len; j++)
			{
				const base x = a[i + j], y = a[i + j + len] * w[j];
				a[i + j] = x + y;
				a[i + j + len] = x - y;
			}
	}

	if (inv)
	{
		reverse(a.begin() + 1, a.end());
		for (auto &it : a)
			it /= n;
	}
}

vector<ll> get_square(const vector<ll> &l)
{
//	vector<ll> ans(2 * l.size() - 1);
//	for (int i = 0; i < int(l.size()); i++)
//		if (l[i])
//			for (int j = 0; j < int(l.size()); j++)
//				if (l[j])
//					ans[i + j] += l[i] * l[j];
//  return ans

	const int len = up(l.size());
	vector<base> fl(2 * len);

	copy(l.begin(), l.end(), fl.begin());
	fft(fl, false);
	for (int i = 0; i < int(fl.size()); i++)
		fl[i] *= fl[i];
	fft(fl, true);

	vector<ll> ans(fl.size());
	for (int i = 0; i < int(fl.size()); i++)
		ans[i] = llround(fl[i].real());
	return ans;
}

ll work(const vector<int> &a)
{
	const int g = find_generator();

	vector<int> disc_log(mod, -1);
	vector<int> pws(mod - 1);

	for (int i = 0, cur = 1; i < mod - 1; i++)
	{
		pws[i] = cur;
		assert(disc_log[cur] == -1);
		disc_log[cur] = i;
		cur = mult(cur, g);
	}

	ll ans = 0;
	vector<ll> arr(mod - 1);

	for (int x : a)
	{
		assert(disc_log[x] != -1);
		arr[disc_log[x]]++;
	}

	vector<ll> res = get_square(arr);

	for (int i = 0; i < int(res.size()); i++)
		ans += pws[i % (mod - 1)] * res[i];

	for (int x : a)
		ans -= ll(x) * x % mod;
	assert(ans >= 0);
	assert(ans % 2 == 0);
	ans /= 2;
	return ans;
}

void solve(istream &cin = std::cin, ostream &cout = std::cout)
{
	int n;
	cin >> n;

	vector<int> a;
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		if (x != 0)
			a.push_back(x);
	}

	cout << work(a) << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	cout << fixed;

#ifdef LOCAL
	auto st = clock();

	ifstream fin("../input.txt");

	do
	{
		solve(fin);

		cout << "===" << endl;

		string str;
		while (getline(fin, str) && str != string(max(1, (int) str.size()), '='));
	} while (fin);

	cout << setprecision(6) << "clock: " << ld(clock() - st) / CLOCKS_PER_SEC << endl;
#else
	solve();
#endif

	return 0;
}


Measured memory_bytes: 32704