#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define prev _prev
#define y0 _y0
#define kill _kill

//permanent constants
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int alf = 26;
const int two = 2;
const ld eps = 1e-8;
const ll INF = (ll)(1e18 + 239);
const int BIG = (int)(2e9 + 239);
const ll MOD = 1e9 + 7;
const ll MOD2 = (ll)MOD * (ll)MOD;

//random
#ifdef ONPC
mt19937_64 rnd(239);
#else
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

//constants
const int M = (int)(2e5 + 239);
const int N = (int)(2e3 + 239);
const int L = 20;
const int T = (1 << 20) + 239;
const int B = 500;
const int X = 1e6 + 239;

typedef complex<ld> cld;

namespace fft {
    int k;
    vector<int> rev;

    void fft(vector<cld> &a) {
        for (int i = 0; i < k; i++)
            if (rev[i] < i)
                swap(a[rev[i]], a[i]);
        cld w, wn, ai, aj;
        for (int s = 1; s < k; s <<= 1) {
            wn = cld(cos(pi / s), sin(pi / s));
            for (int l = 0; l < k; l += s + s) {
                w = 1;
                for (int i = l, j = l + s; i < l + s; i++, j++) {
                    ai = a[i];
                    aj = w * a[j];
                    a[i] = ai + aj;
                    a[j] = ai - aj;
                    w *= wn;
                }
            }
        }
    }

    vector<ll> mult(vector<ll> a, vector<ll> b) {
        k = 1;
        while (k < (int)a.size() + (int)b.size() - 1)
            k <<= 1;
        rev.clear();
        rev.resize(k);
        rev[0] = 0;
        for (int i = 1; i < k; i++) {
            if (i & 1)
                rev[i] = rev[i - 1] + (k >> 1);
            else
                rev[i] = rev[i >> 1] >> 1;
        }
        vector<cld> p(k, 0);
        ld pa, pb;
        for (int i = 0; i < k; i++) {
            pa = 0;
            if (i < (int)a.size())
                pa = a[i];
            pb = 0;
            if (i < (int)b.size())
                pb = b[i];
            p[i] = cld(pa, pb);
        }
        fft(p);
        vector<cld> pr(k, 0);
        cld x, y;
        for (int i = 0; i < k; i++) {
            x = (p[i] + conj(p[(k - i) % k])) / (ld)2;
            y = (p[i] - conj(p[(k - i) % k])) / cld(0, 2);
            pr[i] = (x * y);
        }
        fft(pr);
        reverse(pr.begin() + 1, pr.end());
        for (int i = 0; i < k; i++)
            pr[i] /= k;
        vector<ll> res(k, 0);
        for (int i = 0; i < k; i++)
            res[i] = round(pr[i].real());
        while (res.back() == 0)
            res.pop_back();
        return res;
    }
}

const int p = 200003;

int g;

int id[p];

bool check()
{
    memset(id, -1, sizeof(id));
    id[1] = 0;
    int pw = 1;
    for (int i = 0; i < p - 2; i++)
    {
        pw = 1LL * pw * g % p;
        if (pw == 1)
            return false;
        id[pw] = i + 1;
    }
    return true;
}

int32_t main()
{
#ifdef ONPC
    freopen("input", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    for (g = 2; ; g++)
        if (check())
            break;
    vector<ll> poly(p - 1);
    int n;
    cin >> n;
    vector<int> st;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        if (a == 0)
            continue;
        poly[id[a]]++;
        st.push_back(a);
    }
    vector<ll> res = fft::mult(poly, poly);
    int pw = 1;
    ll ans = 0;
    for (int i = 0; i < (int)res.size(); i++)
    {
        ans += res[i] * (ll)pw;
        pw = 1LL * pw * g % p;
    }
    for (int x : st)
        ans -= 1LL * x * x % p;
    cout << (ans / 2) << "\n";
    return 0;
}

Measured memory_bytes: 49032