#include<bits/stdc++.h>

typedef long long ll;
typedef long double ld;
using namespace std;
//mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 mrand(42);
#define ii for(int i=1;i<=n;++i)
#define ji for(int j=1;j<=n;++j)
#define jj for(int j=1;j<=m;++j)
#define ij for(int i=1;i<=m;++i)
#define sz(x) ((ll)x.size())
#define all(x) x.begin(),x.end()
#define al(x) x+1,x+1+n
#define asd cout<<"ok"<<endl;
#define asdd cout<<"okok"<<endl;
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define pr(v) for(auto i:v) cout<<i<<" ";cout<<endl;
#define prt(a, l, r) for(auto i=l;i<=r;++i) cout<<a[i]<<" ";cout<<endl;
#define pc(x) __builtin_popcount(x)
#define pb push_back
#define PS string qqwwee;cin>>qqwwee;
typedef pair<int,int> pii;

// get primitive root
// if n has primitive root, n = 2, 4, p^k, 2p^k, which p is an odd number
// if n has primitive root, n has phi(phi(n)) roots;
// if g^(phi(n)/p)!=1(mod n) for every p divides phi(n), then g is a primitive root.
// g^x for every (x,phi(n))=1 gives every roots

ll getphi(ll x) {
    ll ret=x;for(ll i=2;i*i<=x;++i) if(x%i==0) {while(x%i==0) x/=i;ret=ret/i*(i-1);}
    if(x>1) ret=ret/x*(x-1); return ret;
}
ll fpow(ll a,ll b,ll mod){ll r=1;for(a%=mod;b;b>>=1){if(b&1)r=r*a%mod;a=a*a%mod;}return r;}
ll getroot(ll p) {
    ll phi=getphi(p); vector<int> vp;
    for(ll i=2;i*i<=phi;++i) {if(phi%i==0) {while(phi%i==0) phi/=i;vp.push_back(i);}}
    if(phi>1) vp.push_back(phi);phi=getphi(p);
    for(int g=2;g<p;++g) {int f=1;for(int i:vp) if(fpow(g,phi/i,p)==1){f=0;break;}if(f)return g;}
    return -1;
}
const int mod = 200003;
int ind[200005], a[200005], pw[810005];

struct cp
{
    double x,y;
    cp(){}
    cp(double a,double b){x=a,y=b;}
    inline cp operator + (cp &a) {return cp{x+a.x,y+a.y};}
    inline cp operator - (cp &a) {return cp{x-a.x,y-a.y};}
    inline cp operator * (cp &a) {return cp{x*a.x-y*a.y,x*a.y+y*a.x};}
    inline void operator /= (double a) {x/=a,y/=a;}
    inline void operator += (cp &a) {x+=a.x,y+=a.y;}
    inline cp conj() {return cp(x,-y);}
};
const int maxn = 800005;
const double PI = acos(-1.0);
cp w[maxn], w_inv[maxn];
void init(int n){for(int i=0;i<n;++i){w[i]=cp(cos(2*PI/n*i),sin(2*PI/n*i)),w_inv[i]=w[i].conj();}}
void fft(cp *a, int n, int f=0) {
    cp *ww;if(f) ww=w;else ww=w_inv;
    for(int i=0,j=0;i<n;++i) {if(i>j) swap(a[i],a[j]);for(int l=n>>1;(j^=l)<l;l>>=1);}
    for(int l=2;l<=n;l<<=1) {int m=l/2;for(cp *p=a;p!=a+n;p+=l){
            for(int i=0;i<m;++i){cp t=ww[n/l*i]*p[m+i];p[m+i]=p[i]-t,p[i]+=t;}}}
    if(f) for(int i=0;i<n;++i) a[i]/=n;
}
cp A[maxn],B[maxn];
// 数组开3~4倍
// int len=1;for(;len<=n+m;len<<=1);
// init(len);
int main() {
    pw[0]=1;ind[1]=0;
    for(int i=1;i<mod;++i) pw[i]=pw[i-1]*2%mod,ind[pw[i]]=i,assert(pw[i]>=0);
    for(int i=mod;i<=4*mod;++i) pw[i]=pw[i-1]*2%mod;
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    ll ans=0;
    for(int i=1;i<=n;++i) {
        int x;
        cin>>x;
        ans-=1ll*x*x%mod;
        if(x) a[ind[x]]++;
    }
    for(int i=0;i<mod;++i) A[i].x=B[i].x=a[i];
    int len=1;for(;len<=mod+mod;len<<=1);init(len);
    fft(A,len);fft(B,len);
    for(int i=0;i<len;++i) A[i]=A[i]*B[i];
    fft(A,len,1);
    for(int i=0;i<len;++i) {ans+=1ll*(ll)(A[i].x+0.5)*pw[i];}
    cout<<ans/2<<endl;
}

Measured memory_bytes: 41452