#include<bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull=unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<"="<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<"="<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n)for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x)((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...)_(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...)
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());const int D=4,dx[]={+1,0,-1,0},dy[]={0,+1,0,-1};
const int M=200003;
namespace fft {
    typedef double dbl;
    struct cpx {
      dbl x,y;
      cpx(){x=y=0;}
      cpx(dbl x_,dbl y_):x(x_),y(y_){}
    };
    inline cpx operator+(cpx a,cpx b){return cpx(a.x+b.x,a.y+b.y);}
    inline cpx operator-(cpx a,cpx b){return cpx(a.x-b.x,a.y-b.y);}
    inline cpx operator*(cpx a,cpx b){return cpx(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline cpx conj(cpx a){ return cpx(a.x,-a.y);}
    int32_t base=1;
    vector<cpx> roots={{0,0},{1,0}};
    vector<int32_t> rev={0,1};
    const dbl PI=static_cast<dbl>(acosl(-1.0));
    void ensure_base(int32_t nbase){
      if(nbase<= base)return;
      rev.resize(1<<nbase);
      for(int32_t i=0;i<(1<<nbase);i++){
        rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
      }
      roots.resize(1<<nbase);
      while(base<nbase){
        dbl angle=2*PI/(1<<(base+1));
        for(int32_t i=1<<(base-1);i<(1<<base);i++){
          roots[i<<1]=roots[i];
          dbl angle_i=angle*(2*i+1-(1<<base));
          roots[(i<<1)+1]=cpx(cos(angle_i),sin(angle_i));
        }
        base++;
      }
    }
    void fft(vector<cpx>& a,int32_t n=-1){
      if(n==-1){
        n=(int32_t)a.size();
      }
      assert((n &(n-1))== 0);
      int32_t zeros=__builtin_ctz(n);
      ensure_base(zeros);
      int32_t shift=base-zeros;
      for(int32_t i=0;i<n;i++){
        if(i<(rev[i]>>shift)){
          swap(a[i],a[rev[i]>>shift]);
        }
      }
      for(int32_t k=1;k<n;k<<=1){
        for(int32_t i=0;i<n;i+=2*k){
          for(int32_t j=0;j<k;j++){
            cpx z=a[i+j+k]*roots[j+k];
            a[i+j+k]=a[i+j]-z;
            a[i+j]=a[i+j]+z;
          }
        }
      }
    }
    vector<cpx> fa,fb;
    vector<int64_t> square(const vector<int>& a){
      if(a.empty()){
        return {};
      }
      int32_t need=(int32_t)a.size()+(int32_t)a.size()-1;
      int32_t nbase=1;
      while((1<<nbase)<need)nbase++;
      ensure_base(nbase);
      int32_t z=1<<nbase;
      if((z>>1)>(int32_t)fa.size())fa.resize(z>>1);
      for(int32_t i=0;i<(z>>1);i++){
        int32_t x=(2*i<(int32_t)a.size()?a[2*i]:0);
        int32_t y=(2*i+1<(int32_t)a.size()?a[2*i+1]:0);
        fa[i]=cpx(x,y);
      }
      fft(fa,z>>1);
      cpx r(1.0/(z>>1),0.0);
      for(int32_t i=0;i<=(z>>2);i++){
        int32_t j=((z>>1)-i)&((z>>1)-1);
        cpx fe=(fa[i]+conj(fa[j]))*cpx(0.5,0);
        cpx fo=(fa[i]-conj(fa[j]))*cpx(0,-0.5);
        cpx aux=fe*fe+fo*fo*roots[(z>>1)+i]*roots[(z>>1)+i];
        cpx tmp=fe*fo;
        fa[i]=r*(conj(aux)+cpx(0,2)*conj(tmp));
        fa[j]=r*(aux+cpx(0,2)*tmp);
      }
      fft(fa,z>>1);
      vector<int64_t> res(need);
      for(int32_t i=0;i<need;i++){
        res[i]=llround(i%2==0 ?fa[i>>1].x:fa[i>>1].y);
      }
      return res;
    }
    vector<int64_t> multiply(const vector<int>& a,const vector<int>& b){
      if(a.empty()|| b.empty()){
        return {};
      }
      if(a==b){
        return square(a);
      }
      int32_t need=(int32_t)a.size()+(int32_t)b.size()-1;
      int32_t nbase=1;
      while((1<<nbase)<need)nbase++;
      ensure_base(nbase);
      int32_t z=1<<nbase;
      if(z >(int32_t)fa.size()){
        fa.resize(z);
      }
      for(int32_t i=0;i<z;i++){
        int32_t x=(i<sz(a)?a[i]:0);
        int32_t y=(i<sz(b)?b[i]:0);
        fa[i]=cpx(x,y);
      }
      fft(fa,z);
      cpx r(0,-0.25/(z>>1));
      for(int32_t i=0;i<=(z>>1);i++){
        int32_t j=(z-i)&(z-1);
        cpx o=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
        fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
        fa[i]=o;
      }
      for(int32_t i=0;i<(z>>1);i++){
        cpx A0=(fa[i]+fa[i+(z>>1)])*cpx(0.5,0);
        cpx A1=(fa[i]-fa[i+(z>>1)])*cpx(0.5,0)*roots[(z>>1)+i];
        fa[i]=A0+A1*cpx(0,1);
      }
      fft(fa,z>>1);
      vector<int64_t> res(need);
      for(int32_t i=0;i<need;i++){
        res[i]=llround(i%2==0 ?fa[i>>1].x:fa[i>>1].y);
      }
      return res;
    }
    vector<int> multiply_mod(const vector<int>& a,const vector<int>& b,int m){
      if(a.empty()|| b.empty()){
        return {};
      }
      int eq=(a.size()==b.size()&& a==b);
      int need=sz(a)+sz(b)-1;
      int nbase=0;
      while((1<<nbase)<need)nbase++;
      ensure_base(nbase);
      int z=1<<nbase;
      if(z>sz(fa)){
        fa.resize(z);
      }
      for(int i=0;i<sz(a);i++){
        int x=(a[i] % m+m)% m;
        fa[i]=cpx(x &((1<<15)-1),x >> 15);
      }
      fill(fa.begin()+ sz(a),fa.begin()+ z,cpx {0,0});
      fft(fa,z);
      if(z>sz(fb)){
        fb.resize(z);
      }
      if(eq){
        copy(fa.begin(),fa.begin()+ z,fb.begin());
      } else {
        for(int i=0;i<sz(b);i++){
          int x=(b[i] % m+m)% m;
          fb[i]=cpx(x &((1<<15)-1),x >> 15);
        }
        fill(fb.begin()+ b.size(),fb.begin()+ z,cpx {0,0});
        fft(fb,z);
      }
      dbl ratio=0.25 / z;
      cpx r2(0,-1);
      cpx r3(ratio,0);
      cpx r4(0,-ratio);
      cpx r5(0,1);
      for(int i=0;i<=(z >> 1);i++){
        int j=(z-i)&(z-1);
        cpx a1=(fa[i]+conj(fa[j]));
        cpx a2=(fa[i]-conj(fa[j]))*r2;
        cpx b1=(fb[i]+conj(fb[j]))*r3;
        cpx b2=(fb[i]-conj(fb[j]))*r4;
        if(i != j){
          cpx c1=(fa[j]+conj(fa[i]));
          cpx c2=(fa[j]-conj(fa[i]))*r2;
          cpx d1=(fb[j]+conj(fb[i]))*r3;
          cpx d2=(fb[j]-conj(fb[i]))*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;
      }
      fft(fa,z);
      fft(fb,z);
      vector<int> res(need);
      for(int i=0;i<need;i++){
        int64_t aa=llround(fa[i].x);
        int64_t bb=llround(fb[i].x);
        int64_t cc=llround(fa[i].y);
        res[i]=static_cast<int>((aa+((bb % m)<<15)+((cc % m)<<30))% m);
      }
      return res;
    }
};
int kto[M];
int a[M],c[M];
int32_t main(){
    int n;
    cin>>n;
    forn(i,n){
        cin>>a[i];
        c[a[i]]++;
    }
    int p=1;
    vector<int> x;
    forn(i,M-1){
        kto[i]=p;
        x.pb(c[p]);
       (p*=2)%=M;
    }
    auto res=fft::multiply(x,x);
    int ans=0;
    forn(i,sz(res)){
        ans+=res[i]*kto[i%(M-1)];
    }
    forn(i,n)ans-=(a[i]*a[i])%M;
    ans/=2;
    cout<<ans<<'\n';
    return 0;
}


Measured memory_bytes: 27512