#include <bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

typedef complex<ld> base;
const ld PI = atan2(0, -1.0);
const int maxn = 1 << 20;

int bitrev(int n, int i) {
    for (int l = 1, r = n / 2; l < r; l <<= 1, r >>= 1) {
        if (((i / l) & 1) != ((i / r) & 1)) i ^= l | r;
    }
    return i;
}

i64 omega = 0;

void fft(int n, base *a, bool inv) {
    forn(i, n) {
        int j = bitrev(n, i);
        if (i < j) swap(a[i], a[j]);
    }
    for (int l = 1; l < n; l *= 2) {
        base w0(cos(PI / l), sin(PI / l) * (inv ? -1 : 1));
        for (int i = 0; i < n; i += 2 * l) {
            base w = 1;
            forn(j, l) {
                base x = a[i + j], y = a[i + l + j];
                base z = y * w;
                a[i + j] = (x + z);
                a[i + l + j] = (x - z);
                w = w * w0;
            }
        }
    }
    if (inv) {
        forn(i, n) a[i] /= n;
    }
}

base pa[maxn], pb[maxn], res[maxn];

void mul(int n, base *a, int m, base *b) {
    int N = 1;
    while (N < n + m) N *= 2;
    forn(i, N) pa[i] = i < n ? a[i] : 0;
    fft(N, pa, false);
    forn(i, N) pb[i] = i < m ? b[i] : 0;
    fft(N, pb, false);
    forn(i, N) pa[i] *= pb[i];
    fft(N, pa, true);
    forn(i, N) res[i] = pa[i];
}

vi64 mul(const vi64 &a, const vi64 &b) {
    int n = a.size(), m = b.size();
    forn(i, n) pa[i] = a[i];
    forn(i, m) pb[i] = b[i];
    mul(n, pa, m, pb);
    vi64 ans(n + m + 3);
    forn(i, n + m - 1) ans[i] = i64(res[i].real() + 0.5);
    while (!ans.empty() && !ans.back()) ans.pop_back();
    return ans;
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "rt", stdin);
#endif

    const int p = 200003;
    i64 x0 = 2;
    vi pws(p - 1), lg(p);
    pws[0] = 1;
    for1(i, p - 2) pws[i] = pws[i - 1] * x0 % p;
    forn(i, p - 1) lg[pws[i]] = i;

    int n;
    cin >> n;
    vi64 a(p - 1);
    forn(i, n) {
        int x;
        cin >> x;
        if (!x) continue;
        ++a[lg[x]];
    }

    vi64 b = mul(a, a);
    vi64 c(p);
    forn(i, b.size()) c[pws[i % (p - 1)]] += b[i];
    i64 ans = 0;
    forn(i, p) ans += 1LL * i * c[i];
    forn(i, p - 1) {
        int y = 1LL * pws[i] * pws[i] % p;
        ans -= 1LL * a[i] * y;
    }
    assert(ans % 2 == 0);
    cout << ans / 2 << '\n';

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 60592