#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <complex>

template <int MOD>
struct ModInt {
    using lint = long long;
    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }

    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }
    bool operator<(const ModInt& b) const { return val < b.val; }
    bool operator<=(const ModInt& b) const { return val <= b.val; }
    bool operator>(const ModInt& b) const { return val > b.val; }
    bool operator>=(const ModInt& b) const { return val >= b.val; }

    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept {
        lint v;
        is >> v;
        x = v;
        return is;
    }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

template <int K>
struct FastFourierTransform {
    using Real = long double;

    struct cplx {
        Real real, imag;

        explicit cplx(Real real = 0, Real imag = 0)
            : real(real), imag(imag) {}

        cplx operator+(const cplx& other) const {
            return cplx(real + other.real, imag + other.imag);
        }
        cplx operator-(const cplx& other) const {
            return cplx(real - other.real, imag - other.imag);
        }
        cplx operator*(const cplx& other) const {
            return cplx(real * other.real - imag * other.imag,
                        real * other.imag + imag * other.real);
        }
        cplx conj() const { return cplx(real, -imag); }
    };
    using cplxs = std::vector<cplx>;

    static constexpr Real PI = 3.14159265358979323846L;
    const cplx unit_i{0, 1};

    cplxs zetas;

    explicit FastFourierTransform() : zetas(K) {
        for (int i = 0; i < K; ++i) {
            zetas[i] = cplx(std::cos(PI * 2 / (1 << i)),
                            std::sin(PI * 2 / (1 << i)));
        }
    }

    // ceil(log_2 n)
    static int clog2(int n) {
        int k = 0;
        while ((1 << k) < n) ++k;
        return k;
    }

    // ceil(log_4 n)
    static int clog4(int n) {
        int k = 0;
        while ((1 << (k * 2)) < n) ++k;
        return k;
    }

    // 4-radix cooley-tukey algorithm without bit reverse
    // the size of f must be a power of 4
    void fft(cplxs& f) const {
        int n = f.size();

        for (int m = n >> 2; m >= 1; m >>= 2) {
            auto zeta = zetas[clog2(m) + 2];
            cplx zeta1(1), zeta2, zeta3;

            for (int p = 0; p < m; ++p) {
                zeta2 = zeta1 * zeta1;
                zeta3 = zeta1 * zeta2;

                for (int s = 0; s < n; s += (m << 2)) {
                    auto w = f[s + p + m * 0],
                         x = f[s + p + m * 1],
                         y = f[s + p + m * 2],
                         z = f[s + p + m * 3];

                    auto wyp = w + y,
                         wym = w - y,
                         xzp = x + z,
                         xzm = (x - z) * unit_i;

                    f[s + p + m * 0] = wyp + xzp;
                    f[s + p + m * 1] = (wym + xzm) * zeta1;
                    f[s + p + m * 2] = (wyp - xzp) * zeta2;
                    f[s + p + m * 3] = (wym - xzm) * zeta3;
                }
                zeta1 = zeta1 * zeta;
            }
        }
    }

    // the inverse of above function
    void ifft(cplxs& f) const {
        int n = f.size();

        for (int m = 1; m <= (n >> 2); m <<= 2) {
            auto zeta = zetas[clog2(m) + 2].conj();
            cplx zeta1 = cplx(1), zeta2, zeta3;

            for (int p = 0; p < m; ++p) {
                zeta2 = zeta1 * zeta1;
                zeta3 = zeta1 * zeta2;

                for (int s = 0; s < n; s += (m << 2)) {
                    auto w = f[s + p + m * 0],
                         x = f[s + p + m * 1] * zeta1,
                         y = f[s + p + m * 2] * zeta2,
                         z = f[s + p + m * 3] * zeta3;

                    auto wyp = w + y,
                         wym = w - y,
                         xzp = x + z,
                         xzm = (x - z) * unit_i;

                    f[s + p + m * 0] = wyp + xzp;
                    f[s + p + m * 1] = wym - xzm;
                    f[s + p + m * 2] = wyp - xzp;
                    f[s + p + m * 3] = wym + xzm;
                }
                zeta1 = zeta1 * zeta;
            }
        }

        auto ninv = cplx(1.L / n);
        for (auto& x : f) x = x * ninv;
    }

    // main routine
    using lint = long long;
    using lints = std::vector<lint>;

    lints convolute(const lints& f, const lints& g) const {
        int fsz = f.size(),
            gsz = g.size();

        // simple convolution in small cases
        if (std::min(fsz, gsz) < 8) {
            lints ret(fsz + gsz - 1, 0);
            for (int i = 0; i < fsz; ++i) {
                for (int j = 0; j < gsz; ++j) {
                    ret[i + j] += f[i] * g[j];
                }
            }
            return ret;
        }

        auto fc = li2cp(f),
             gc = li2cp(g);

        int n = 1 << (clog4(fsz + gsz - 1) * 2);
        fc.resize(n, cplx(0));
        gc.resize(n, cplx(0));

        fft(fc);
        fft(gc);

        for (int i = 0; i < n; ++i) fc[i] = fc[i] * gc[i];

        ifft(fc);

        fc.resize(fsz + gsz - 1);
        return cp2li(fc);
    }

    // lint <-> complex
    cplxs li2cp(const lints& f) const {
        cplxs ret;
        std::transform(f.begin(), f.end(), std::back_inserter(ret),
                       [](auto x) { return cplx(x); });
        return ret;
    }

    lints cp2li(const cplxs& f) const {
        lints ret;
        std::transform(f.begin(), f.end(), std::back_inserter(ret),
                       [](auto x) { return std::llround(x.real); });
        return ret;
    }
};

constexpr int MOD = 200003;
using mint = ModInt<MOD>;
const FastFourierTransform<25> FFT;

using lint = long long;

void solve() {
    // g^log[x] = x
    std::vector<int> log(MOD);
    mint g = 2;
    for (int i = 0; i < MOD - 1; ++i) {
        log[g.pow(i).val] = i;
    }

    std::vector<lint> cnt(MOD - 1, 0);

    int n;
    std::cin >> n;
    while (n--) {
        int a;
        std::cin >> a;
        if (a != 0) ++cnt[log[a]];
    }

    // FFTで畳み込む
    auto res = FFT.convolute(cnt, cnt);

    lint ans = 0;
    for (int i = 0; i < (int)res.size(); ++i) {
        lint num = llround(res[i]);
        ans += g.pow(i).val * num;
    }

    // a_i * a_iを省く
    for (int i = 0; i < (int)cnt.size(); ++i) {
        lint num = llround(cnt[i]);
        ans -= g.pow(i * 2).val * num;
    }

    // i > jを省く
    ans /= 2;

    std::cout << ans << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


Measured memory_bytes: 78608