#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define IN freopen("alchemy_input.txt","r",stdin)
#define OUT freopen("output.txt","w",stdout)

#define pb push_back
#define mp make_pair
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG printf("Hi\n")
#define i64 long long int
#define ui64 unsigned long long int
#define xx first
#define yy second
#define ln 17
#define off 2

#define sq(x) ((x)*(x))

#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace __gnu_pbds;
using namespace std ;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<int,int> pii;

//#define log 20
#define mod 200003
#define INF 2000000000
#define maxn 1000005

const long double eps = 1e-9 ;

struct FFT {
    struct node {
        double x,y;
        node() {}
        node(double a, double b): x(a), y(b) {}
        node operator + (const node &a) const {
            return node(this->x+a.x,this->y+a.y);
        }
        node operator - (const node a) const {
            return node(this->x-a.x,this->y-a.y);
        }
        node operator * (const node a) const {
            return node(this->x*a.x-this->y*a.y,this->x*a.y+a.x*this->y);
        }
    };

    int M;
    vector<node> A, B, w[2];
    vector<int> rev;
    long double pi = acos(-1.0);
    void init(int n) {
        M = 1;
        while(M < n) M <<= 1;
        M <<= 1;
        A.resize(M); B.resize(M);
        w[0].resize(M); w[1].resize(M);
        rev.resize(M);
        for (int i=0; i<M; i++) {
            int j=i,y=0;
            for (int x=1; x<M; x<<=1,j>>=1) (y<<=1)+=j&1;
            rev[i]=y;
        }
        for (int i=0; i<M; i++) {
            w[0][i] = node( cos(2*pi*i/M),sin(2*pi*i/M) );
            w[1][i] = node( cos(2*pi*i/M),-sin(2*pi*i/M) );
        }
    }
    void ftransform( vector<node> &A, int p ) {
        for (int i=0; i<M; i++)
            if (i<rev[i])
                swap(A[i],A[rev[i]]);
        for (int i=1; i<M; i<<=1)
            for (int j=0,t=M/(i<<1); j<M; j+=i<<1)
                for (int k=0,l=0; k<i; k++,l+=t) {
                    node x=w[p][l]*A[i+j+k];
                    node y=A[j+k];
                    A[j+k]=y+x;
                    A[j+k+i]=y-x;
                }
        if (p)
            for (int i=0; i<M; i++)
                A[i].x/=M;
    }
    /// multiply P*Q and keeps the result in res
    ///degree of P is n and degree of Q is m
    ///P, Q is given in standard power form, in increasing
    void multiply( vector<int> &P, vector<int> &Q, vector<i64> &res) {
        init( max(P.size(),Q.size()) );
        for( int i = 0; i < M; i++ )
            A[i].x = A[i].y = B[i].x = B[i].y = 0;
        for( int i = 0; i < P.size(); i++ )
            A[i].x = P[i];
        for( int i = 0; i < Q.size(); i++ )
            B[i].x = Q[i];
        ftransform(A,0);
        ftransform(B,0);
        for (int k=0; k<M; k++)
            A[k] = A[k]*B[k];
        ftransform(A,1);
        res.resize(M);
        for( int i = 0; i < M; i++ )
            res[i] = round(A[i].x);
    }
};

int proot = 2 ;
int bigMod(int a, int n)
{
    if(n==0) return 1 ;
    int r = bigMod(a,n/2) ;
    r = (1LL*r*r)%mod ;
    if( (n%2) ) r = (1LL*r*a)%mod ;
    return r ;
}

int which[maxn] ;

int a[maxn] , cnt[maxn] ;

int main()
{
    for(int i=0 ; i<mod-1 ; i++)
    {
        which[ bigMod(proot,i) ] = i ;
    }

    i64 ans = 0 ;

    int n ;

    scanf("%d",&n) ;
    int m = 0 ;

    for(int i=1 ; i<=n ; i++)
    {
        int x ;
        scanf("%d",&x) ;
        if(x==0) continue ;

        a[++m] = x ;

        cnt[ which[ a[m] ] ]++ ;
        ans -= (1LL*a[m]*a[m])%mod ;
    }

    n = m ;
//    DBG ;

    vector <int> v ;
    for(int i=0 ; i<mod-1; i++) v.pb( cnt[i] ) ;

    FFT fft ;

    fft.init(mod-1) ;

    vector <i64> res ;

    fft.multiply(v,v,res) ;

    for(int i=0 ; i<res.size() ; i++)
    {
        ans += 1LL*bigMod(proot,i)*res[i] ;
  //      if( res[i] > 0 ) printf("%d %lld\n",bigMod(proot,i),res[i]) ;
    }

    printf("%lld\n",ans/2) ;

    return 0 ;
}


Measured memory_bytes: 45888