#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define MD (200003U)
#define PI 3.14159265358979323846
void *wmem;
char memarr[96000000];
template<class S, class T> inline S max_L(S a,T b){
  return a>=b?a:b;
}
template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){
  static int skip[16] = {0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  (*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned long long)(*mem)) & 15] );
  (*arr)=(T*)(*mem);
  (*mem)=((*arr)+x);
}
inline int my_getchar_unlocked(){
  static char buf[1048576];
  static int s = 1048576;
  static int e = 1048576;
  if(s == e && e == 1048576){
    e = fread_unlocked(buf, 1, 1048576, stdin);
    s = 0;
  }
  if(s == e){
    return EOF;
  }
  return buf[s++];
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
struct MY_WRITER{
  char buf[1048576];
  int s;
  int e;
  MY_WRITER(){
    s = 0;
    e = 1048576;
  }
  ~MY_WRITER(){
    if(s){
      fwrite_unlocked(buf, 1, s, stdout);
    }
  }
}
;
MY_WRITER MY_WRITER_VAR;
void my_putchar_unlocked(int a){
  if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
    fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
    MY_WRITER_VAR.s = 0;
  }
  MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
}
inline void wt_L(char a){
  my_putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    my_putchar_unlocked('-');
  }
  while(s--){
    my_putchar_unlocked(f[s]+'0');
  }
}
template<class T> inline int isPrime_L(T n){
  T i;
  if(n<=1){
    return 0;
  }
  if(n<=3){
    return 1;
  }
  if(n%2==0){
    return 0;
  }
  for(i=3;i*i<=n;i+=2){
    if(n%i==0){
      return 0;
    }
  }
  return 1;
}
template<class T> int Factor_L(T N, T fac[], int fs[]){
  T i;
  int sz = 0;
  if(N%2==0){
    fac[sz] = 2;
    fs[sz] = 1;
    N /= 2;
    while(N%2==0){
      N /= 2;
      fs[sz]++;
    }
    sz++;
  }
  for(i=3;i*i<=N;i+=2){
    if(N%i==0){
      fac[sz] = i;
      fs[sz] = 1;
      N /= i;
      while(N%i==0){
        N /= i;
        fs[sz]++;
      }
      sz++;
    }
  }
  if(N > 1){
    fac[sz] = N;
    fs[sz] = 1;
    sz++;
  }
  return sz;
}
template<class T> int Divisor_L(T N, T res[], void *mem = wmem){
  int i;
  int j;
  int k;
  int s;
  int sz = 0;
  T *fc;
  int *fs;
  int fsz;
  walloc1d(&fc, 100, &mem);
  walloc1d(&fs, 100, &mem);
  fsz =Factor_L(N, fc, fs);
  res[sz++] = 1;
  for(i=(0);i<(fsz);i++){
    s = sz;
    k = s * fs[i];
    for(j=(0);j<(k);j++){
      res[sz++] = res[j] * fc[i];
    }
  }
  sort(res, res+sz);
  return sz;
}
unsigned long long powmod(unsigned long long a, unsigned long long b, unsigned long long m){
  unsigned long long r = 1;
  while(b){
    if(b&1){
      r = r * a % m;
    }
    b>>=1;
    a = a * a % m;
  }
  return r;
}
long long primitiveRoot(long long p, void *mem = wmem){
  int ys;
  long long *y;
  long long r;
  if(!isPrime_L(p)){
    return -1;
  }
  walloc1d(&y, 100000, &mem);
  ys =Divisor_L(p-1, y, mem);
  for(r=(1);r<(p);r++){
    int i;
    for(i=(0);i<(ys-1);i++){
      if(powmod(r,y[i],p) == 1){
        goto H31bcJ8S;
      }
    }
    return r;
    H31bcJ8S:;
  }
  return -1;
}
struct fft_pnt{
  double x;
  double y;
  fft_pnt(void){
  }
  fft_pnt(double a, double b){
    x = a;
    y = b;
  }
  void set(double a, double b){
    x = a;
    y = b;
  }
  fft_pnt& operator+=(fft_pnt a){
    x+=a.x;
    y+=a.y;
    return *this;
  }
  fft_pnt& operator-=(fft_pnt a){
    x-=a.x;
    y-=a.y;
    return *this;
  }
  fft_pnt& operator*=(fft_pnt a){
    fft_pnt p = *this;
    x = p.x*a.x-p.y*a.y;
    y = p.x*a.y+p.y*a.x;
    return *this;
  }
  fft_pnt operator+(fft_pnt a){
    return fft_pnt(*this) += a;
  }
  fft_pnt operator-(fft_pnt a){
    return fft_pnt(*this) -= a;
  }
  fft_pnt operator*(fft_pnt a){
    return fft_pnt(*this) *= a;
  }
}
;
void fft_L(int n, fft_pnt x[], void *mem){
  int i;
  int j;
  int n1;
  int n2;
  int n3;
  int step = 1;
  double theta = 2*PI / n;
  double tmp;
  fft_pnt w1;
  fft_pnt w2;
  fft_pnt w3;
  fft_pnt a;
  fft_pnt b;
  fft_pnt c;
  fft_pnt d;
  fft_pnt aa;
  fft_pnt bb;
  fft_pnt cc;
  fft_pnt dd;
  fft_pnt *y = (fft_pnt*)mem;
  while(n > 2){
    n1 = n / 4;
    n2 = n1 + n1;
    n3 = n1 + n2;
    for(i=(0);i<(n1);i++){
      w1 = fft_pnt(cos(i*theta),-sin(i*theta));
      w2 = w1*w1;
      w3 = w1*w2;
      for(j=(0);j<(step);j++){
        a = x[j+step*i];
        b = x[j+step*(i+n1)];
        c = x[j+step*(i+n2)];
        d = x[j+step*(i+n3)];
        aa = a + c;
        bb = a - c;
        cc = b + d;
        dd = b - d;
        tmp = dd.y;
        dd.y = dd.x;
        dd.x = -tmp;
        y[j+step*(4*i  )] = aa + cc;
        y[j+step*(4*i+1)] = w1*(bb - dd);
        y[j+step*(4*i+2)] = w2*(aa - cc);
        y[j+step*(4*i+3)] = w3*(bb + dd);
      }
    }
    n /= 4;
    step *= 4;
    theta *= 4;
    swap(x,y);
  }
  if(n==2){
    for(i=(0);i<(step);i++){
      y[i] = x[i] + x[i+step];
      y[i+step] = x[i] - x[i+step];
    }
    n /= 2;
    step *= 2;
    theta *= 2;
    swap(x,y);
  }
  for(i=(0);i<(step);i++){
    y[i] = x[i];
  }
}
void fftinv_L(int n, fft_pnt x[], void *mem){
  int i;
  int j;
  int n1;
  int n2;
  int n3;
  int step = 1;
  double theta = 2*PI / n;
  double tmp;
  fft_pnt w1;
  fft_pnt w2;
  fft_pnt w3;
  fft_pnt a;
  fft_pnt b;
  fft_pnt c;
  fft_pnt d;
  fft_pnt aa;
  fft_pnt bb;
  fft_pnt cc;
  fft_pnt dd;
  fft_pnt *y = (fft_pnt*)mem;
  while(n > 2){
    n1 = n / 4;
    n2 = n1 + n1;
    n3 = n1 + n2;
    for(i=(0);i<(n1);i++){
      w1 = fft_pnt(cos(i*theta),sin(i*theta));
      w2 = w1*w1;
      w3 = w1*w2;
      for(j=(0);j<(step);j++){
        a = x[j+step*i];
        b = x[j+step*(i+n1)];
        c = x[j+step*(i+n2)];
        d = x[j+step*(i+n3)];
        aa = a + c;
        bb = a - c;
        cc = b + d;
        dd = b - d;
        tmp = dd.y;
        dd.y = dd.x;
        dd.x = -tmp;
        y[j+step*(4*i  )] = aa + cc;
        y[j+step*(4*i+1)] = w1*(bb + dd);
        y[j+step*(4*i+2)] = w2*(aa - cc);
        y[j+step*(4*i+3)] = w3*(bb - dd);
      }
    }
    n /= 4;
    step *= 4;
    theta *= 4;
    swap(x,y);
  }
  if(n==2){
    for(i=(0);i<(step);i++){
      y[i] = x[i] + x[i+step];
      y[i+step] = x[i] - x[i+step];
    }
    n /= 2;
    step *= 2;
    theta *= 2;
    swap(x,y);
  }
  for(i=(0);i<(step);i++){
    y[i] = x[i];
  }
}
void convolution_L(double A[], int As, double B[], int Bs, double res[], int Rs, void *mem = wmem){
  int i;
  int n;
  int n2;
  double mul;
  fft_pnt *a;
  fft_pnt *b;
  n =max_L(As+Bs, Rs);
  for(n2=1;n2<n;n2*=2){
    ;
  }
  walloc1d(&a, n2, &mem);
  walloc1d(&b, n2, &mem);
  for(i=(0);i<(As);i++){
    a[i].set(A[i], 0);
  }
  int Wv3_QJ0O = n2;
  for(i=(As);i<(Wv3_QJ0O);i++){
    a[i].set(0,0);
  }
  for(i=(0);i<(Bs);i++){
    b[i].set(B[i], 0);
  }
  int dtztiDQx = n2;
  for(i=(Bs);i<(dtztiDQx);i++){
    b[i].set(0,0);
  }
  fft_L(n2, a, mem);
  fft_L(n2, b, mem);
  for(i=(0);i<(n2);i++){
    a[i] *= b[i];
  }
  fftinv_L(n2, a, mem);
  mul = 1.0 / n2;
  for(i=(0);i<(Rs);i++){
    res[i] = a[i].x * mul;
  }
}
void convolution_L(double A[], int As, double res[], int Rs, void *mem = wmem){
  int i;
  int n;
  int n2;
  double mul;
  fft_pnt *a;
  n =max_L(As+As, Rs);
  for(n2=1;n2<n;n2*=2){
    ;
  }
  walloc1d(&a, n2, &mem);
  for(i=(0);i<(As);i++){
    a[i].set(A[i], 0);
  }
  int MNlRFaTx = n2;
  for(i=(As);i<(MNlRFaTx);i++){
    a[i].set(0,0);
  }
  fft_L(n2, a, mem);
  for(i=(0);i<(n2);i++){
    a[i] *= a[i];
  }
  fftinv_L(n2, a, mem);
  mul = 1.0 / n2;
  for(i=(0);i<(Rs);i++){
    res[i] = a[i].x * mul;
  }
}
int N;
int A[200000];
int cnv[MD];
int rev[MD];
double a[200000+5];
double c[400000+10];
int main(){
  wmem = memarr;
  int i;
  int j;
  int k;
  int rt = primitiveRoot(MD);
  long long res = 0;
  long long tmp;
  k = 1;
  for(i=(0);i<(MD-1);i++){
    cnv[k] = i;
    k = (k * 2) % MD;
  }
  for(i=(1);i<(MD);i++){
    rev[cnv[i]] = i;
  }
  rd(N);
  {
    int cTE1_r3A;
    for(cTE1_r3A=(0);cTE1_r3A<(N);cTE1_r3A++){
      rd(A[cTE1_r3A]);
    }
  }
  k = 0;
  for(i=(0);i<(N);i++){
    if(A[i]){
      A[k++] = A[i];
    }
  }
  N = k;
  for(i=(0);i<(N);i++){
    a[cnv[A[i]]]++;
  }
  convolution_L(a,MD,c,2*MD);
  for(i=(0);i<(2*MD);i++){
    tmp = (long long)(c[i] + 0.5);
    res += tmp * rev[i%(MD-1)];
  }
  for(i=(0);i<(N);i++){
    res -= ((long long) A[i] * A[i]) % MD;
  }
  res /= 2;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200509-1

// --- original code ---
// #define MD 200003
// int N, A[2d5];
// int cnv[MD], rev[MD];
// 
// double a[2d5+5], c[4d5+10];
// 
// {
//   int i, j, k;
//   int rt = primitiveRoot(MD);
//   ll res = 0, tmp;
// 
//   k = 1;
//   rep(i,MD-1){
//     cnv[k] = i;
//     k = (k * 2) % MD;
//   }
//   rep(i,1,MD) rev[cnv[i]] = i;
// 
//   rd(N,A(N));
//   k = 0;
//   rep(i,N) if(A[i]) A[k++] = A[i];
//   N = k;
// 
//   rep(i,N) a[cnv[A[i]]]++;
//   convolution(a,MD,c,2*MD);
//   rep(i,2*MD){
//     tmp = (ll)(c[i] + 0.5);
//     res += tmp * rev[i%(MD-1)];
//   }
// 
//   rep(i,N) res -= ((ll) A[i] * A[i]) % MD;
//   res /= 2;
// 
//   wt(res);
// }


Measured memory_bytes: 28356