#include <bits/stdc++.h>
#define pb push_back
#define pll pair <ll, ll>
#define mp make_pair
#define pyshnapyshnakaa ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define x first
#define y second
#pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
#define plll pair <pair <ll, ll>, ll>
#define pllll pair <pair <ll, ll>, pair <ll, ll> >
#define psl pair <string, ll>
#define pld pair <ld, ld>
#define all(a) a.begin(), a.end()
#define vvl vector <vector <ll> >
#define cld complex <double>

typedef long long ll;

typedef long double ld;

using namespace std;

const ll maxn = 1e6 + 100;
const ll mod = 2e5 + 3;

ll n, m, k, t;

const ld PI = acos(-1);

ll st2[maxn];

ll rev(ll x, ll lg) {
    ll ans = 0;
    ll q;
    for (q = 0; q < lg; q++) {
        if ((x & (1 << q)) != 0) {
            ans += (1<<(lg - q - 1))/*st2[lg - q - 1]*/;
        }
    }
    return ans;
}

void fft(vector <cld> &A, bool inv) {
    ll lg = 0, n = 1;
    while (n < A.size()) {
        n *= 2;
        lg++;
    }
    // cout << n << " " << lg << endl;
    for (ll q = 0; q < A.size(); q++) {
        if (q < rev(q, lg)) {
            swap(A[q], A[rev(q, lg)]);
        }
    }
    assert(n == A.size());
    for (ll len = 2; len <= n; len *= 2) {
        double ang = 2 * PI / len;
        // cout << ang / PI << " ANG" << endl;
        if (inv) {
            ang *= -1;
        }
        // cout << endl;
        // for (ll q = 0; q < A.size(); q++) {
        //     cout << A[q] << " ";
        // }
        // cout << endl;
        // cout << ang << " ANG " << cos(ang) << " " << sin(ang) << endl;
        cld base(cos(ang), sin(ang));
        // cout << base << " BASE" << endl;
        for (ll q = 0; q < n; q += len) {
            cld w1 = 1;
            for (ll w = q; w < q + len / 2; w++) {
                cld x1 = A[w] + w1 * A[w + len / 2];
                cld x2 = A[w] - w1 * A[w + len / 2];
                A[w] = x1;
                A[w + len / 2] = x2;
                w1 *= base;
            }
        }
        // for (ll q = 0; q < A.size(); q++) {
        //     cout << A[q] << " ";
        // }
        // cout << endl;
    }
    if (inv) {
        for (ll q = 0; q < A.size(); q++) {
            A[q] /= n;
        }
    }
}

vector <ll> multiply(vector <ll> A, vector <ll> B) {
    vector <cld> A1(A.begin(), A.end()), B1(B.begin(), B.end());
    ll n = 1;
    while (n < max(A.size(), B.size())) {
        n *= 2;
    }
    n *= 2;
    A1.resize(n); B1.resize(n);
    // cout << n << endl;
    fft(A1, 0);
    fft(B1, 0);
    for (ll q = 0; q < A1.size(); q++) {
        A1[q] = A1[q] * B1[q];
    }
    fft(A1, 1);
    vector <ll> ANS(A1.size());
    for (ll q = 0; q < A1.size(); q++) {
        ANS[q] = (ll)(A1[q].real() + 0.5);
    }
    return ANS;
}

inline ll step(ll a, ll x) {
    if (x == 0) {
        return 1;
    }
    if (x % 2 == 1) {
        return step(a, x - 1) * a % mod;
    }
    ll t = step(a, x / 2);
    return t * t % mod;
}

inline ll del(ll a, ll b) {
    return a * step(b, mod - 2) % mod;
}

ll A[maxn];

ll I[maxn];

ll RI[maxn];

vector <ll> C;

int main() {
    pyshnapyshnakaa
    ll q, w, e, a, b, c;
    cin >> n;
    C.resize(mod);
    ll g = 2;
    ll cur = 2;
    ll i = 1;
    RI[0] = 1;
    while (cur != 1) {
        I[cur] = i;
        RI[i] = cur;
        i++;
        cur = (cur * g) % mod;
    }
    // cout << i << endl;
    for (q = 0; q < n; q++) {
        cin >> A[q];
        if (A[q] == 0) {
            continue;
        }
        C[I[A[q]]]++;
    }
    vector <ll> ANS = multiply(C, C);
    ll ans = 0;
    for (q = 0; q < ANS.size(); q++) {
        ans += ANS[q] * (step(g, q));
    }
    for (q = 0; q < n; q++) {
        ans -= A[q] * A[q] % mod;
    }
    cout << ans / 2;
    return 0;
}

Measured memory_bytes: 33476