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

namespace fft {

struct Complex {
  double re, im;
  Complex() : re(0), im(0) {}
  Complex(double r, double i) : re(r), im(i) {}

  Complex operator+(const Complex &rhs) const {
    return Complex(re + rhs.re, im + rhs.im);
  }
  Complex operator-(const Complex &rhs) const {
    return Complex(re - rhs.re, im - rhs.im);
  }
  Complex operator*(const Complex &rhs) const {
    return Complex(re * rhs.re - im * rhs.im, re * rhs.im + im * rhs.re);
  }
  Complex Conjugate() const { return Complex(re, -im); }
};

constexpr double kPi = acos(-1);
constexpr int kN = 524288;
Complex omega[kN + 1];

void Prefft() {
  for (int i = 0; i <= kN; ++i) {
    omega[i] = Complex(cos(2 * kPi * i / kN), sin(2 * kPi * i / kN));
  }
}

void Bitrev(vector<Complex> &v, int n) {
  int z = __builtin_ctz(n) - 1;
  for (int i = 0; i < n; ++i) {
    int x = 0;
    for (int j = 0; (1 << j) < n; ++j) x ^= (i >> j & 1) << (z - j);
    if (x > i) swap(v[x], v[i]);
  }
}

void Trans(vector<Complex> &v, int n) {
  Bitrev(v, n);
  for (int s = 2; s <= n; s <<= 1) {
    int z = s >> 1;
    for (int i = 0; i < n; i += s) {
      for (int k = 0; k < z; ++k) {
        Complex x = v[i + z + k] * omega[kN / s * k];
        v[i + z + k] = v[i + k] - x;
        v[i + k] = v[i + k] + x;
      }
    }
  }
}

void InvTrans(vector<Complex> &v, int n) {
  Trans(v, n);
  reverse(v.begin() + 1, v.end());
  for (int i = 0; i < n; ++i) v[i] = v[i] * Complex(1. / n, 0);
}

vector<int64_t> Multiply(const vector<int> &a, const vector<int> &b) {
  // Should be able to handle N <= 10^5, C <= 10^4
  int sz = 1;
  while (sz < a.size() + b.size() - 1) sz <<= 1;
  vector<Complex> v(sz);
  for (int i = 0; i < sz; ++i) {
    double re = i < a.size() ? a[i] : 0;
    double im = i < b.size() ? b[i] : 0;
    v[i] = Complex(re, im);
  }
  Trans(v, sz);
  const Complex r(0, -0.25);
  for (int i = 0; i <= sz / 2; ++i) {
    int j = (sz - i) & (sz - 1);
    Complex x = (v[i] + v[j].Conjugate()) * (v[i] - v[j].Conjugate()) * r;
    if (j != i)
      v[j] = (v[j] + v[i].Conjugate()) * (v[j] - v[i].Conjugate()) * r;
    v[i] = x;
  }
  InvTrans(v, sz);
  vector<int64_t> c(sz);
  for (int i = 0; i < sz; ++i) c[i] = round(v[i].re);
  return c;
}

vector<int> Multiply(const vector<int> &a, const vector<int> &b, int p) {
  int sz = 1, n = a.size(), m = b.size();
  while (sz < n + m - 1) sz <<= 1;
  vector<Complex> fa(sz), fb(sz);
  for (int i = 0; i < n; ++i) {
    fa[i] = Complex(a[i] & ((1 << 15) - 1), a[i] >> 15);
  }
  for (int i = 0; i < m; ++i) {
    fb[i] = Complex(b[i] & ((1 << 15) - 1), b[i] >> 15);
  }
  Trans(fa, sz), Trans(fb, sz);
  const double r = 0.25 / sz;
  const Complex r2(0, -1), r3(r, 0), r4(0, -r), r5(0, 1);
  for (int i = 0; i <= (sz >> 1); ++i) {
    int j = (sz - i) & (sz - 1);
    Complex a1 = (fa[i] + fa[j].Conjugate());
    Complex a2 = (fa[i] - fa[j].Conjugate()) * r2;
    Complex b1 = (fb[i] + fb[j].Conjugate()) * r3;
    Complex b2 = (fb[i] - fb[j].Conjugate()) * r4;
    if (i != j) {
      Complex c1 = (fa[j] + fa[i].Conjugate());
      Complex c2 = (fa[j] - fa[i].Conjugate()) * r2;
      Complex d1 = (fb[j] + fb[i].Conjugate()) * r3;
      Complex d2 = (fb[j] - fb[i].Conjugate()) * r4;
      fa[i] = c1 * d1 + c2 * d2 * r5;
      fb[i] = c1 * d2 + c2 * d1;
    }
    fa[j] = a1 * b1 + a2 * b2 * r5;
    fb[j] = a1 * b2 + a2 * b1;
  }
  Trans(fa, sz), Trans(fb, sz);
  vector<int> res(sz);
  for (int i = 0; i < sz; ++i) {
    int64_t a = round(fa[i].re);
    int64_t b = round(fb[i].re);
    int64_t c = round(fa[i].im);
    res[i] = (a + ((b % p) << 15) + ((c % p) << 30)) % p;
  }
  res.resize(n + m - 1);
  return res;
}

}  // namespace fft

int main() {
  constexpr int kP = 200'003;
  constexpr int kG = 2;

  auto fpow = [&](int a, int n, int P) {
    int res = 1;
    while (n > 0) {
      if (n & 1) res = 1LL * res * a % P;
      a = 1LL * a * a % P;
      n >>= 1;
    }
    return res;
  };

  vector<int> order(kP, -1), pw(kP);
  for (int i = 0, x = 1; i < kP; ++i) {
    pw[i] = x;
    order[x] = i;
    x = 1LL * x * kG % kP;
  }

  int n;
  cin >> n;
  int zero = 0;
  vector<int> cnt(kP);
  
  int64_t res = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    res -= 1LL * x * x % kP;
    if (x == 0) {
      zero += 1;
    } else {
      cnt[order[x]] += 1;
    }
  }
  fft::Prefft();
  auto poly = fft::Multiply(cnt, cnt);
  for (int i = 0; i < poly.size(); ++i) {
    res += poly[i] * pw[i % (kP - 1)];
  }
  cout << res / 2 << "\n";
  return 0;
}


Measured memory_bytes: 26616