#define CPP17
#include <limits>
#include <initializer_list>
#include <utility>
#include <bitset>
#include <tuple>
#include <type_traits>
#include <functional>
#include <string>
#include <array>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iterator>
#include <algorithm>
#include <complex>
#include <random>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <regex>
#include <cassert>
#include <cstddef>
#ifdef CPP17
#include <variant>
#endif

#define endl codeforces

#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)

using ll = std::int64_t;
using ull = std::uint64_t;
using pii = std::pair<int, int>;
using tii = std::tuple<int, int, int>;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
using size_type = ssize_t;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }

template <typename T, std::size_t Head, std::size_t... Tail> 
struct multi_dim_array { using type = std::array<typename multi_dim_array<T, Tail...>::type, Head>; };

template <typename T, std::size_t Head> 
struct multi_dim_array<T, Head> { using type = std::array<T, Head>; };

template <typename T, std::size_t... Args> using mdarray = typename multi_dim_array<T, Args...>::type;

#ifdef CPP17
template <typename T, typename F, typename... Args> 
void fill_seq(T &t, F f, Args... args) { 
    if constexpr (std::is_invocable<F, Args...>::value) { 
        t = f(args...); 
    } else { 
        for (size_type i = 0; i < t.size(); i++) fill_seq(t[i], f, args..., i); 
    } 
}
#endif

template <typename T> vec<T> make_v(size_type sz) { return vec<T>(sz); }

template <typename T, typename... Tail> 
auto make_v(size_type hs, Tail&&... ts) { 
    auto v = std::move(make_v<T>(std::forward<Tail>(ts)...)); 
    return vec<decltype(v)>(hs, v); 
}

namespace init__ { 
struct InitIO { 
    InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } 
} init_io; 
}
#define CPP17


namespace math {

template <typename T>
constexpr T pow(const T &n, ll k) {
    T ret = n.mul_id_ele();
    T cur = n;
    while (k) {
        if (k & 1) ret *= cur;
        cur *= cur;
        k /= 2;
    }
    return ret;
}

}

namespace math {

template <ll Mod>
struct Modint {

    constexpr Modint(ll x) noexcept : x((Mod + x % Mod) % Mod) { }
    
    constexpr Modint() noexcept : Modint(0) { }
    
    constexpr Modint<Mod> add_id_ele() const noexcept { 
        return Modint<Mod>(0); 
    }
    
    constexpr Modint<Mod> mul_id_ele() const noexcept {
        return Modint<Mod>(1); 
    }
    
    constexpr ll& value() noexcept { 
        return x; 
    }
    
    constexpr ll value() const noexcept {
        return x; 
    }

    constexpr Modint& operator+=(const Modint &oth) noexcept {
        x += oth.value();
        if (Mod <= x) x -= Mod;
        return *this;
    }

    constexpr Modint& operator-=(const Modint &oth) noexcept {
        x += Mod - oth.value();
        if (Mod <= x) x -= Mod;
        return *this;
    }

    constexpr Modint& operator*=(const Modint &oth) noexcept {
        x *= oth.value();
        x %= Mod;
        return *this;
    }

    constexpr Modint& operator/=(const Modint &oth) noexcept {
        x *= oth.inv().value();
        x %= Mod;
        return *this;
    }

    constexpr Modint operator+(const Modint &oth) const noexcept {
        return Modint(x) += oth;
    }

    constexpr Modint operator-(const Modint &oth) const noexcept {
        return Modint(x) -= oth;
    }

    constexpr Modint operator*(const Modint &oth) const noexcept {
        return Modint(x) *= oth;
    }

    constexpr Modint operator/(const Modint &oth) const noexcept {
        return Modint(x) /= oth;
    }

    constexpr Modint operator-() const noexcept {
        return Modint((x != 0) * (Mod - x)); 
    }

    constexpr bool operator==(const Modint &oth) const noexcept {
        return value() == oth.value();
    }

    template <typename T>
    constexpr typename std::enable_if<std::is_integral<T>::value, const Modint&>::type
    operator=(T t) noexcept {
        (*this) = Modint(std::forward<T>(t)); 
        return *this;
    }

    constexpr Modint inv() const noexcept {
        return ::math::pow(*this, Mod - 2);
    }

    constexpr ll mod() const noexcept {
        return Mod;
    }

private:
    ll x;
};

template <ll Mod>
Modint<Mod> inv(Modint<Mod> m) {
    m.inv();
    return m;
}

template <ll Mod>
std::istream& operator>>(std::istream &is, Modint<Mod> &m) {
    ll v;
    is >> v;
    m = v;
    return is;
}

template <ll Mod>
std::ostream& operator<<(std::ostream &os, Modint<Mod> m) {
    os << m.value();
    return os;
}

}

namespace math {

namespace ntt_helper {

template <ll Mod>
constexpr bool is_primitive_root(ll r) {
    Modint<Mod> mr(r);
    for (ll d = 2; d * d <= Mod; d++) {
        if ((Mod - 1) % d == 0) {
            if (pow(mr, d).value() == 1) return false;
            if (pow(mr, (Mod - 1) / d).value() == 1) return false;
        }
    }
    return true;
}

template <ll Mod>
constexpr ll find_primitive_root(ll r) {
    return (is_primitive_root<Mod>(r) ? r : find_primitive_root<Mod>(r + 1));
}

template <ll Mod>
constexpr ll find_primitive_root() {
    return find_primitive_root<Mod>(2);
}

constexpr auto calc_max_base(ll m) {
    ll ret = 0;
    for (; m % 2 == 0; ret++, m /= 2);
    return ret;
}

}

template <ll Mod, ll PrimitiveRoot>
struct ntt__ {
    using mint = Modint<Mod>;
    using value_type = mint;

    constexpr ntt__() 
        :  root_lis(max_size_log), 
           iroot_lis(max_size_log)
    {
        for (size_type i = 0; i < static_cast<size_type>(root_lis.size()); i++) {
            root_lis[i] = pow(mint(PrimitiveRoot), (Mod - 1) >> (i + 2)) * -1;
            iroot_lis[i] = root_lis[i].inv();
        }
    }

    void multiply(vec<value_type> &a, vec<value_type> b) {
        size_type m = a.size(), n = b.size();
        size_type sz = 1, res_sz = n + m - 1;
        while (sz < res_sz) sz *= 2;
        a.resize(sz); b.resize(sz);
        ntt(a, sz, false);
        ntt(b, sz, false);
        auto isz = mint(sz).inv();
        for (size_type i = 0; i < sz; i++) a[i] *= b[i] * isz;
        ntt(a, sz, true);
        a.resize(res_sz);
    }

private:
    static constexpr size_type max_size_log = ntt_helper::calc_max_base(Mod - 1);
    static constexpr size_type max_size = 1ll << max_size_log;
    static constexpr size_type max_conv_size = max_size * 2;

    vec<mint> root_lis, iroot_lis;
    using buf_iterator = typename vec<mint>::iterator;

    void ntt(vec<value_type> &v, size_type sz, bool inv) {
        if (!inv) {
            for (int m = sz / 2; m; m /= 2) {
                mint mul = 1;
                for(int s = 0, k = 0; s < sz; s += 2 * m) {
                    for(int i = s, j = s + m; i < s + m; ++i, ++j) {
                        auto x = v[i], y = v[j] * mul;
                        v[i] = x + y;
                        v[j] = x - y;
                    }
                    mul *= root_lis[__builtin_ctz(++k)];
                }
            }
        } else {
            for (int m = 1; m < sz; m *= 2) {
                mint mul = 1;
                for (int s = 0, k = 0; s < sz; s += 2 * m) {
                    for (int i = s, j = s + m; i < s + m; i++, j++) {
                        auto l = v[i], r = v[j];
                        v[i] = l + r;
                        v[j] = (l - r) * mul;
                    }
                    mul *= iroot_lis[__builtin_ctz(++k)];
                }
            }
        }
    }
};

template <ll Mod>
using NTT = ntt__<Mod, ntt_helper::find_primitive_root<Mod>()>;

}

namespace utility {

template <typename T, T... Args>
constexpr std::array<T, sizeof...(Args)> 
make_array(std::integer_sequence<T, Args...>) {
    return {{ Args... }};
}

template <typename, typename>
struct tuple_concat;

template <typename... Args1, typename... Args2>
struct tuple_concat<std::tuple<Args1...>, std::tuple<Args2...>> {
    using type = std::tuple<Args1..., Args2...>;
};

template <ll... N1, ll... N2>
constexpr auto concat_integer_sequence(std::integer_sequence<ll, N1...>, std::integer_sequence<ll, N2...>) {
    return std::integer_sequence<ll, N1..., N2...>();
}

template <ll Head, ll... Tail>
struct reverse_sequence {
    using head_type = std::integer_sequence<ll, Head>;
    using tail_type = typename reverse_sequence<Tail...>::type;
    using type = decltype(concat_integer_sequence(std::declval<tail_type>(), std::declval<head_type>()));
};

template <ll Head>
struct reverse_sequence<Head> {
    using type = std::integer_sequence<ll, Head>;
};

template <ll... N>
constexpr auto reverse_ns(std::integer_sequence<ll, N...>) {
    return typename reverse_sequence<N...>::type();
}

}

namespace math {

template <ll Mod, ll... Mods>
ll garner(const std::array<ll, sizeof...(Mods)> &mr_) {
    constexpr size_type sz = sizeof...(Mods) + 1;
    std::array<ll, sz> mr;
    std::array<ll, sz> mods = {{ Mods..., Mod }};
    std::copy(ALL(mr_), mr.begin());
    mr.back() = 0;
    
    std::array<ll, sz> coffs, cnsts;
    std::fill(ALL(coffs), 1);
    std::fill(ALL(cnsts), 0);

    auto add = [](ll a, ll b, ll mod) {
        return (a + b + mod) % mod;
    };

    auto mul = [](ll a, ll b, ll mod) {
        return a * b % mod;
    };

    auto mod_pow = [&](ll n, ll k, ll mod) {
        ll ret = 1, cur = n;
        while (k) {
            if (k & 1) ret = mul(ret, cur, mod);
            cur = mul(cur, cur, mod);
            k /= 2;
        }
        return ret;
    };

    auto mod_inv = [&](ll n, ll mod) {
        return mod_pow(n, mod - 2, mod);
    };

    for (size_type i = 0; i < sz - 1; i++) {
        const ll v = mul(add(mr[i], mods[i] - cnsts[i], mods[i]), 
                         mod_inv(coffs[i], mods[i]),
                         mods[i]);

        for (size_type j = i + 1; j < sz; j++) {
            cnsts[j] = add(cnsts[j],
                           mul(coffs[j], v, mods[j]),
                           mods[j]);
            coffs[j] = mul(coffs[j],
                           mods[i],
                           mods[j]);
                           
        }
	}

    return cnsts.back();
}

}

int main() {
    constexpr ll mod = 200'003;  // 2
    constexpr ll mod1 = 469762049;  // 3
    constexpr ll mod2 = 167772161;  // 3
    using mint1 = math::Modint<mod1>;
    using mint2 = math::Modint<mod2>;

    ll n;
    std::cin >> n;
    vec<ll> av;
    for (ll i = 0; i < n; i++) {
        ll e;
        std::cin >> e;
        if (e) av.push_back(e);
    }
    n = av.size();

    math::NTT<mod1> ntt1;
    math::NTT<mod2> ntt2;

    /*
    math::NTT<mod> hage;
    hage.hage();
    */

    vec<ll> mod2g(mod, -1), g2mod(mod, - 1);
    {
        ll p = 1;
        for (ll i = 0; i < mod - 1; i++) {
            mod2g[p] = i;
            g2mod[i] = p;
            p *= 2;
            p %= mod;
        }
    }

    vec<ll> coef(mod);
    for (ll e : av) coef[mod2g[e]]++;

    vec<mint1> coef1(mod);
    vec<mint2> coef2(mod);
    for (ll i = 0; i < mod; i++) {
        coef1[i] = coef[i];
        coef2[i] = coef[i];
    }
    auto cpy1 = coef1;
    auto cpy2 = coef2;

    ntt1.multiply(coef1, std::move(cpy1));
    ntt2.multiply(coef2, std::move(cpy2));
    ll ans = 0;

    for (ll i = 0; i < coef1.size(); i++) {
        ll e1 = coef1[i].value(), e2 = coef2[i].value();
        std::array<ll, 2> arr = {{ e1, e2 }};
        ll e = math::garner<mod1 * mod2, mod1, mod2>(arr);
        ll p = i % (mod - 1);
        ans += e * g2mod[p];
    }

    for (ll e : av) ans -= e * e % mod;
    ans /= 2;
    std::cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 23248