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

namespace FFT {
    using Real = double;
    using Ret = int64_t;

    struct C {
        Real x, y;
        C() : x(0), y(0) {}
        C(Real x, Real y): x(x), y(y) {}
        inline C operator+ (const C &rhs) { return C(x+rhs.x, y+rhs.y); }
        inline C operator- (const C &rhs) { return C(x-rhs.x, y-rhs.y); }
        inline C operator* (const C &rhs) { return C(x*rhs.x-y*rhs.y, x*rhs.y+y*rhs.x); }
        inline C conj() { return C(x, -y); }
    };
    
    const Real pi = acosl(-1);
    int base = 1;
    vector<C> w = {{0, 0}, {1, 0}};
    vector<int> rev = {0, 1};
    
    void ensure(int nbase) {
        if (nbase <= base) return;
        rev.resize(1 << nbase);
        w.resize(1 << nbase);
        for (int i = 0; i < (1 << nbase); i++) {
            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nbase - 1));
        }
        while (base < nbase) {
            Real angle = pi * 2.0 / (1 << (base + 1));
            for (int i = 1 << (base - 1); i < (1 << base); i++) {
                w[i << 1] = w[i];
                Real angle_i = angle * (2*i + 1 - (1 << base));
                w[(i << 1) + 1] = C(cos(angle_i), sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<C> &a, int n) {
        assert((n & (n - 1)) == 0);
        int z = __builtin_ctz(n);
        ensure(z); int sft = base - z; 
        for (int i = 0; i < n; i++) {
            if (i < (rev[i] >> sft)) swap(a[i], a[rev[i] >> sft]);
        }
        for (int k = 1; k < n; k <<= 1) {
            for (int i = 0; i < n; i += 2*k) {
                for (int j = 0; j < k; j++) {
                    C c = a[i + j + k] * w[j + k];
                    a[i + j + k] = a[i + j] - c;
                    a[i + j] = a[i + j] + c; 
                }
            }
        }
    }

    vector<Ret> mult(const vector<int> &a, const vector<int> &b) {
        int n = a.size() + b.size() - 1;
        int nbase = 1;
        while ((1 << nbase) < n) nbase++;
        ensure(nbase); int sz = 1 << nbase; 
        vector<C> f(sz);
        for (int i = 0; i < sz; i++) {
            int x = i < a.size() ? a[i] : 0;
            int y = i < b.size() ? b[i] : 0;
            f[i] = C(x, y);
        }
        fft(f, sz);
        C r(0, -0.25 / (sz >> 1)), s(0, 1), t(0.5, 0);
        for (int i = 0; i <= (sz >> 1); i++) {
            int j = (sz - i) & (sz - 1);
            C z = (f[j] * f[j] - (f[i] * f[i]).conj()) * r;
            f[j] = (f[i] * f[i] - (f[j] * f[j]).conj()) * r;
            f[i] = z; 
        }
        for (int i = 0; i < (sz >> 1); i++) {
            C a = (f[i] + f[i + (sz >> 1)]) * t;
            C b = (f[i] - f[i + (sz >> 1)]) * t * w[(sz >> 1) + i];
            f[i] = a + b*s;
        }
        fft(f, sz >> 1);
        vector<Ret> ret(n);
        for (int i = 0; i < n; i++) {
            ret[i] = llround(i & 1 ? f[i >> 1].y : f[i >> 1].x);
        }
        return ret;
    }
};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    constexpr long long P = 200003;
    constexpr long long U = 2;
    vector<long long> S(P-1, 1);
    vector<long long> Inv(P, 0);
    for (int i = 1; i < P-1; i++) S[i] = S[i-1] * U % P;
    for (int i = 0; i < P-1; i++) Inv[S[i]] = i;
    int N; cin >> N;
    long long Ans = 0;
    vector<int> A(P, 0);
    for (int i = 0; i < N; i++) {
        int a; cin >> a;
        if (a == 0) continue;
        int inv = Inv[a];
        A[inv]++, Ans -= S[inv*2%(P-1)]; 
    }
    auto Res = FFT::mult(A, A);
    for (int i = 0; i < Res.size(); i++) {
        Ans += Res[i] * S[i%(P-1)];
    }
    assert(Ans % 2 == 0);
    cout << Ans / 2 << "\n";
    return 0;
}

Measured memory_bytes: 29184