#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

// https://www.creativ.xyz/fast-fourier-transform/
// Cooley–Tukey FFT algorithm O(N log N)
vector<complex<double>> fft(vector<complex<double>> a, bool inverse = false) {
  int n = a.size();
  int h = 0; // h = log_2(n)
  for (int i = 0; 1 << i < n; i++)
    h++;
  // バタフライ演算用の配置入れ替え
  for (int i = 0; i < n; i++) {
    int j = 0;
    for (int k = 0; k < h; k++)
      j |= (i >> k & 1) << (h - 1 - k);
    if (i < j)
      swap(a[i], a[j]);
  }
  // バタフライ演算
  for (int b = 1; b < n; b *= 2) {
    // 第 log_2(b) + 1 段
    // ブロックサイズ = b * 2
    for (int j = 0; j < b; j++) {
      // ブロック内 j 個目
      // 重み w = (1 の原始 2b 乗根の j 乗)
      complex<double> w =
          polar(1.0, (2 * M_PI) / (2 * b) * j * (inverse ? 1 : -1));
      for (int k = 0; k < n; k += b * 2) {
        // k を先頭とするブロック
        complex<double> s = a[j + k];         // 前
        complex<double> t = a[j + k + b] * w; // 後
        a[j + k] = s + t;                     // 前の更新
        a[j + k + b] = s - t;                 // 後の更新
      }
    }
  }
  // 逆変換時にサイズで割る調整
  if (inverse)
    for (int i = 0; i < n; i++)
      a[i] /= n;
  return a;
}
// Cooley–Tukey FFT algorithm O(N log N)
vector<complex<double>> fft(vector<double> a, bool inverse = false) {
  int n = a.size();
  vector<complex<double>> a_complex(n);
  for (int i = 0; i < n; i++)
    a_complex[i] = complex<double>(a[i], 0);
  return fft(a_complex, inverse);
}

// FFT による畳み込み O(N log N)
vector<double> convolve(vector<double> a, vector<double> b) {
  int s = a.size() + b.size() - 1; // 畳み込み結果のサイズ
  int t = 1;                       // FFT に使う配列のサイズ（2 の累乗）
  while (t < s)
    t *= 2;
  a.resize(t); // FFT するためにリサイズ
  b.resize(t); // FFT するためにリサイズ
  vector<complex<double>> A = fft(a);
  vector<complex<double>> B = fft(b);
  for (int i = 0; i < t; i++) {
    A[i] *= B[i]; // 畳み込み結果の FFT 結果を得る
  }
  A = fft(A, true); // IFFT で畳み込み結果を得る
  a.resize(s);      // 畳み込み結果を入れるためにリサイズ
  for (int i = 0; i < s; i++)
    a[i] = A[i].real(); // 実部が答え
  return a;
}

const ll P = 200003;
vll cnt(P, 0);
vector<double> cntd(P);
vll ml2(P, 0);
vll ex2(P, 1);

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  
  {
    ll c = 1;
    rep(i, P){
      ml2[c] = i;
      ex2[i] = c;
      c = (c*2)%P;
    }
  }
  
  ll n;
  cin >> n;
  vll a(n);
  rep(i, n){
    cin >> a[i];
    if(a[i] > 0) cnt[ml2[a[i]]]++;
  }
  rep(i, P){
    cntd[i] = cnt[i];
  }
  auto ansv = convolve(cntd, cntd);
  vll ansv2;
  for(auto&& e: ansv){
    ansv2.emplace_back(round(e));
  }
  ll ans = 0;
  rep(i, SZ(ansv2)){
    ans += ansv2[i]*ex2[i%(P-1)];
  }
  rep(i, n){
    ans -= (a[i]*a[i])%P;
  }
  ans /= 2;
  print(ans);
}


Measured memory_bytes: 48080