#include <stdio.h>
#include <vector>
#include <utility>
#include <stdlib.h>
#include <assert.h>


#define ll long long
#define ii std::pair<ll,ll>
#define NTTK1 27ll
#define NTTK2 26ll
/*Magic*/
ll ntt_mod;
ll ntt_kr;
ll ntt_k;

const ll ntt_mod1 = 0x78000001ll; //2013265921
const ll ntt_modi1 = 0x78000001ll; //2013265921
const ll ntt_mod2 = 0x1C000001ll;
const ll ntt_modi2 = 0x1C000001ll;
const ll ntt_kr1 = 137ll;
const ll ntt_kr2 = 30ll;
const ll all_mod = 0xD20000094000001ll;

typedef struct poly{
  std::vector<ll> coef;  
}poly;

ll nttR[NTTK1 + 1][2];

ll mul(ll a, ll b){
  return (a*b) >= ntt_mod ? (a*b)%ntt_mod:(a*b);  
};

ll add(ll a, ll b){
  return (a + b) >= ntt_mod ? (a+b)-ntt_mod : (a+b);
};

ll rm(ll a){
  return a >= 0ll ? a: a + ntt_mod;  
};

ii mmul(ll a, ll m){
  if(m%a == 0)return ii{1ll,0ll};  
  ii tmp = mmul(m%a,a);
  return {add(tmp.second,rm(-1ll*mul(tmp.first,(m/a)))),tmp.first};
};

ll mexp(ll b, ll e, ll m){
  ll erg = 1;  
  ll akt = b;
  ll akB = 1;
  while(e){
    if(e & akB){
      erg *= akt;  
      erg %= m;
      e ^= akB;
    };
    akt *= akt;
    akt %= m;
    akB *= 2;
  };
  return erg;
};

void init(){
  nttR[ntt_k][1] = ntt_kr;  
  nttR[ntt_k][0] = rm(mmul(nttR[ntt_k][1],ntt_mod).first);
  for(int i = ntt_k-1;i>=0;i--){
    nttR[i][0] = mul(nttR[i+1][0],nttR[i+1][0]);  
    nttR[i][1] = mul(nttR[i+1][1],nttR[i+1][1]);  
  };
};

void ntt(std::vector<ll> &in, std::vector<ll> &out, int inv){
  int sz = in.size();  
  for(int i = 0;i<sz;i++)out[i] = in[i];
  int cnt = 0;
  for(int i = 1;i<sz;i++){
    int bt = sz >> 1;  
    while(cnt&bt){
      cnt ^= bt;  
      bt >>= 1;
    };
    cnt ^= bt;
    if(cnt > i)std::swap(out[i],out[cnt]);
  };
  int ss = 2;
  int ps = 1;
  cnt = 1;
  while(ss <= sz){
    ll ar = nttR[cnt][inv];
    for(int i = 0;i<sz;i+=ss){
      ll arr = 1;
      for(int j = i;j<i+ps;j++){
        ll f1 = out[j]; 
        ll f2 = mul(out[j+ps],arr);
        out[j] = add(f2,f1);
        out[j + ps] = add(f1,rm(-1ll*f2)); 
        arr = mul(arr,ar);
      };  
    };
    ss <<=1;
    ps <<=1;
    cnt++;
  };
  ll intt = rm(mmul(sz,ntt_mod).first);
  if(inv){
    for(auto &i:out)i = mul(i,intt);  
  };
};


void setM(int v, int ix=1){
  if(!v){
    ntt_mod = ntt_mod1;
    ntt_k = NTTK1;
    ntt_kr = ntt_kr1;
  }else{
    ntt_mod = ntt_mod2;
    ntt_k = NTTK2;
    ntt_kr = ntt_kr2;
  };  
  if(ix)init();
};


ll chn(ll a, ll b){
  setM(0,0);
  ll mi2 = mmul(ntt_mod2,ntt_mod1).first;
  setM(1,0);
  ll mi1 = mmul(ntt_mod1,ntt_mod2).first;
  ll tmp1 = (mi2 * ntt_mod2)%all_mod;
  ll tmp2 = (mi1 * ntt_mod1)%all_mod;
  __int128 t1 = tmp1;
  __int128 t2 = tmp2;
  __int128 a1 = a;
  __int128 b1 = b;
  __int128 t3 = all_mod;
  __int128 tt1 = (t1 * a1)%t3;
  __int128 tt2 = (t2 * b1)%t3;
  ll erg = (tt1 + tt2)%t3;
  return erg;
};

poly mulPH(poly &a, poly &b){
  int sz = std::max(a.coef.size(),b.coef.size()); 
  int nsz = 0;
  while((1ll<<nsz)<sz)nsz++;
  nsz++;
  std::vector<ll> p1(1ll<<nsz,0);
  std::vector<ll> p2(1ll<<nsz,0);
  for(int i = 0;i<a.coef.size();i++)p1[i] = a.coef[i];
  for(int i = 0;i<b.coef.size();i++)p2[i] = b.coef[i];
  ntt(p1,p1,0);
  ntt(p2,p2,0);
  for(int i = 0;i<p1.size();i++){
    p1[i] = mul(p1[i],p2[i]);  
  };
  ntt(p1,p1,1);
  return {p1};
}; 

poly mulP(poly &a, poly &b){
  setM(0);
  auto c1 = mulPH(a,b);
  setM(1);
  auto c2 = mulPH(a,b); 
  for(int i = 0;i<c1.coef.size();i++){
    c1.coef[i] = chn(c1.coef[i],c2.coef[i]);  
  };
  return c1;
}
#define MM 200003ll

ll mp[MM];
ll mmp[MM];

int main(void){
  mp[0] = 1; 
  mmp[1] = 0;
  for(int i = 1;i<MM-1;i++){
    mp[i] = (mp[i-1] * 2) % MM;  
    mmp[mp[i]] = i;
  };
  poly a;
  a.coef = std::vector<ll>(MM);
  std::vector<int> asq;
  int n;
  scanf("%d",&n);
  int al;
  for(int i = 0;i<n;i++){
    scanf("%d",&al);  
    if(al){
      asq.push_back(al);
      a.coef[mmp[al]]++;
      //printf("%d %lld\n",al,mmp[al]);
      //printf("%lld\n",mexp(2,mmp[al],MM));
    };
  };
  auto b = mulP(a,a);
  ll erg = 0;
  for(int i = 0;i<asq.size();i++){
    b.coef[mmp[asq[i]] * 2]--;
  };
  for(int i = 0;i<b.coef.size();i++){
    if(b.coef[i] != 0){
      if(i >= MM-1){
        erg += b.coef[i]/2 * mp[i-MM+1];  
        //printf("add: %lld %d\n",mp[i-MM+1],i-MM+1);
      }else{
        erg += b.coef[i]/2 * mp[i];  
        //printf("add: %lld %d\n",mp[i],i);
      };    
    };
  };
  printf("%lld\n",erg);
  return 0;
};




Measured memory_bytes: 24704