#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(...) ;
#else
#define debug(...) cerr << __LINE__ << " : " << #__VA_ARGS__ << " = " << _tostr(__VA_ARGS__) << endl;

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v);

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}

void _tostr_rec(ostringstream &oss) {
  oss << "\b\b \b";
}

template<typename Head, typename... Tail>
void _tostr_rec(ostringstream &oss, Head &&head, Tail &&... tail) {
  oss << head << ", ";
  _tostr_rec(oss, forward<Tail>(tail)...);
}

template<typename... T>
string _tostr(T &&... args) {
  ostringstream oss;
  int size = sizeof...(args);
  if (size > 1) oss << "{";
  _tostr_rec(oss, forward<T>(args)...);
  if (size > 1) oss << "}";
  return oss.str();
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010

ll power(ll k, ll n, int M) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * k % M;
    k = k * k % M;
    n /= 2;
  }
  return res;
}

ll getPrimitiveRoot(ll P) {
  // assert(isPrime(P) && P >= 3);
  ll p = P - 1;
  vector<ll> a;

  for (int i = 2; i * i <= p; i++) {
    if (p % i == 0) a.push_back(i);
    while (p % i == 0) p /= i;
  }
  if (p > 1) a.push_back(p);

  while (1) {
    bool ok = true;
    ll r = rand() % (P - 2) + 2;
    for (auto q : a)
      ok &= power(r, (P - 1) / q, P) != 1;
    if (ok) return r;
  }
}

/* Fast Fourier Transform */

namespace FFT {
  using C = complex<double>;

  void DFT(vector<C> &a, bool rev = false) {
    int N = a.size();
    //const double M_PI = acos(-1);

    for (int i = 0, j = 1; j + 1 < N; j++) {
      for (int k = N >> 1; k > (i ^= k); k >>= 1)
        ;
      if (i > j) swap(a[i], a[j]);
    }

    for (int i = 1; i < N; i *= 2) {
      for (int j = 0; j < i; j++) {
        C w = polar(1.0, M_PI / i * (rev ? -1 : 1) * j);
        for (int k = 0; k < N; k += i * 2) {
          C s = a[j + k], t = a[j + k + i] * w;
          a[j + k + 0] = s + t;
          a[j + k + i] = s - t;
        }
      }
    }

    if (rev)
      for (C &v : a) v /= N;
  }

  vector<ll> conv(const vector<int> &a, const vector<int> &b) {
    int s = 1, t = a.size() + b.size() - 1;
    while (s < t) s *= 2;

    vector<C> F(s), G(s);
    for (int i = 0; i < (int)a.size(); i++) F[i] = a[i];
    for (int i = 0; i < (int)b.size(); i++) G[i] = b[i];
    DFT(F);
    DFT(G);

    for (int i = 0; i < s; i++) F[i] *= G[i];
    DFT(F, true);

    vector<ll> res(t);
    for (int i = 0; i < t; i++) res[i] = F[i].real() + 0.5; //round
    return res;
  }
};

int main() {
  const int P = 200003;
  const ll R = getPrimitiveRoot(P);
  int counter[SIZE] = {};

  int N, A;
  ll ans = 0;

  scanf("%d", &N);

  for (int i = 0; i < N; i++) {
    scanf("%d", &A);
    counter[A]++;
    ans -= (ll)A * A % P;
  }

  vector<int> v1(P), v2;

  ll t = 1;
  for (int i = 0; i < P - 1; i++) {
    v1[i] += counter[t];
    t = t * R % P;
  }
  v2 = v1;

  auto v = FFT::conv(v1, v2);

  t = 1;
  for (auto p : v) {
    ans += t * p;
    t = t * R % P;
  }

  cout << ans / 2 << endl;

  return 0;
}

Measured memory_bytes: 25564