#include "bits/stdc++.h"
using namespace std;

// DEBUG BEGIN
template<typename L, typename R> ostream &operator<<(ostream &out, pair<L, R> p){
	return out << "(" << p.first << ", " << p.second << ")";
}
template<class Tuple, size_t N> struct TuplePrinter{
	static ostream &print(ostream &out, const Tuple &t){ return TuplePrinter<Tuple, N-1>::print(out, t) << ", " << get<N-1>(t); }
};
template<class Tuple> struct TuplePrinter<Tuple, 1>{
	static ostream &print(ostream &out, const Tuple& t){ return out << get<0>(t); }
};
template<typename... Args> ostream &print_tuple(ostream &out, const tuple<Args...> &t){
	return TuplePrinter<decltype(t), sizeof...(Args)>::print(out << "(", t) << ")";
}
template<typename ...Args> ostream &operator<<(ostream &out, const tuple<Args...> &t){
	return print_tuple(out, t);
}
template<typename ...Args, template<typename...> typename T> ostream &operator<<(enable_if_t<!is_same<T<Args...>, string>::value, ostream> &out, T<Args...> arr){
	out << "{"; for(auto &x: arr) out << x << ", ";
	return out << (arr.size() ? "\b\b" : "") << "}";
}
template<typename T, size_t N> ostream &operator<<(ostream &out, array<T, N> arr){
	out << "{"; for(auto &x: arr) out << x << ", ";
	return out << (arr.size() ? "\b\b" : "") << "}";
}
template<size_t S> ostream &operator<<(ostream &out, bitset<S> b){
	for(int i = 0; i < S; ++ i) out << b[i];
	return out;
}
void debug_out(){ cerr << "\b\b " << endl; }
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){ cerr << H << ", ", debug_out(T...); }
void debug2_out(){ cerr << "-----DEBUG END-----\n"; }
template<typename Head, typename... Tail>
void debug2_out(Head H, Tail... T){ cerr << "\n"; for(auto x: H) cerr << x << "\n"; debug2_out(T...); }
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#define debug2(...) cerr << "----DEBUG BEGIN----\n[" << #__VA_ARGS__ << "]:", debug2_out(__VA_ARGS__)
#else
#define debug(...) 42
#define debug2(...) 42
#endif
// DEBUG END

typedef complex<double> cd;
const double PI = acos(-1);
template<typename IT>
void fft(IT begin, IT end, const bool invert = false){
	int n = distance(begin, end);
	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(*(begin + i), *(begin + j));
	}
	for(int len = 1; len < n; len <<= 1){
		double theta = PI / len * (invert ? -1 : 1);
		cd w(cos(theta), sin(theta));
		for(int i = 0; i < n; i += len << 1){
			cd wj(1);
			for(int j = 0; j < len; ++ j, wj *= w){
				cd u = *(begin + i + j), v = wj * *(begin + i + j + len);
				*(begin + i + j) = u + v, *(begin + i + j + len) = u - v;
			}
		}
	}
	if(invert) for(auto it = begin; it != end; ++ it) *it /= n;
}
template<typename Poly>
Poly operator*(const Poly &a, const Poly &b){
	vector<cd> f(a.begin(), a.end()), g(b.begin(), b.end());
	int n = max(int(a.size()) + int(b.size()) - 1, 1);
	if(__builtin_popcount(n) != 1) n = 1 << __lg(n) + 1;
	f.resize(n), g.resize(n);
	fft(f.begin(), f.end()), fft(g.begin(), g.end());
	for(int i = 0; i < n; ++ i) f[i] *= g[i];
	fft(f.begin(), f.end(), true);
	Poly res(n);
	for(int i = 0; i < n; ++ i) res[i] = round(f[i].real());
	while(!res.empty() && !res.back()) res.pop_back();
	return res;
}

int main(){
	cin.tie(0)->sync_with_stdio(0);
	const int p = 200003;
	vector<int> exp(p, -1), rev(p - 1);
	for(auto i = 0, r = 1; i < p - 1; ++ i, r = r * 2 % p){
		exp[r] = i;
		rev[i] = r;
	}
	int n;
	cin >> n;
	vector<long long> poly(p - 1);
	long long res = 0;
	for(auto i = 0; i < n; ++ i){
		int x;
		cin >> x;
		if(x){
			++ poly[exp[x]];
		}
		res -= 1LL * x * x % p;
	}
	poly = poly * poly;
	for(auto i = 0; i < int(poly.size()); ++ i){
		res += poly[i] * rev[i % (p - 1)];
	}
	cout << res / 2 << "\n";
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

Measured memory_bytes: 27124