#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <chrono>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define pii pair<ll,pi >
#define ppi pair<pi,ll>
#define ppp pair<pi,pi >
#define ex(str,a,b) str.substr((int)(a),min((int)str.size()-a,(int)(b-a+1))) 
#define all(X) X.begin(),X.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   __builtin_popcount(n) : no. of set bits in n.
*/

const int M = (1<<20)+5;
const int md = 200003;

priority_queue<ll,vector<ll >,greater<ll > > pq;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

namespace fft 
{ 
	#define sz(a) (int)(a).size()
	#define cd comp<double>
	const ld PI = acos((ld)-1) ;
	template < class T> class comp 
	{
		public: T r,i; comp (T a = (T)0, T b = (T)0) : r(a), i(b) {}
	 	comp conj() { return comp(this->r, -(this->i));  }
	    comp operator=(const comp& a){ this->r = a.r, this->i = a.i; return *this; }
	    comp operator+(const comp& b){ return comp(r+b.r, i+b.i); }
	    comp operator-(const comp& b){ return comp(r-b.r, i-b.i); }
		comp operator*(const T& num){ return comp(r*num, i*num); }
	    comp operator/(const T& num){ return comp(r/num, i/num); }
	    comp operator*(const comp& b){ return comp(r*b.r - i*b.i, i*b.r + r*b.i);}
	    comp operator/(const comp& b){ return ((*this)*comp(b.r,-b.i))/(b.x*b.x + b.y*b.y);}
	};
    vector<cd> w ; vector<ll> rev ;
    void revb(int nl) 
    {
    	static int l=-1;
		if(nl==l) return; 
		int t,j,k=0;l=nl;
		rev.resize(l+1); 
		while ((1 << k) < nl) 
			++k;
        for(ll i = 1;i <= l; ++i) 
        {
        	j=rev[i-1]; t=k-1;
			while(t >= 0 && ((j >> t) & 1) )  
				j ^= (1<<t) , --t ;
            if(t>=0)
             j ^= (1<<t), --t ; rev[i] = j;
        }
    }
    void fft(vector<cd> &poly,int inv = false)
    {//sz(poly) should be 2^x
        int len, l; 
        revb(poly.size());
        for(ll i = 0;i < poly.size(); ++i) 
        	if(rev[i]>i) 
        		swap(poly[i],poly[rev[i]]);
        cd u,v; 
        if(sz(w) < sz(poly)) 
        	w.resize(sz(poly)) ;
        for(len=2, l=1; len<=sz(poly); len +=len, l +=l) 
        {
            if(w[l].r==0 && w[l].i==0) 
            { 
            	ld ang = PI / l;
                cd ww(cos(ang),sin(ang));
                if(l > 1) 
                { 
                	for(ll j = 0;j < l;++j) 
                		w[l+j] = (j&1) ? w[(l+j)>>1]*ww : w[(l+j)>>1] ;
                } 
                else 
                	w[l] = cd(1.0,0.0);
            } 
            for(int i = 0; i < sz(poly); i += len) 
            {
            	for(ll j = 0;j < l; ++j) 
	            {
	                u = poly[i+j], v = poly[i+j+l] * (inv ? w[l+j].conj() : w[l+j]) ;
	                poly[i+j] = u + v , poly[i+j+l] = u - v ;
				}
        	}
        } 
        if(inv) 
        	for(auto &x:poly) 
        		x = x /sz(poly) ;//returns vi:convolution of a,b
    } 
    vector<ll> multiply(vector<ll> &a,vector<ll> &b)
    { 
    	int bi=1, sz1=a.size()+b.size(), rsz;
        //making total size a power of 2
        while((1<<bi)<sz1) 
            ++bi; 
        rsz = (1<<bi);
        vector<cd> poly(rsz) ; 
        for(ll i = 0;i < a.size(); ++i) 
        	poly[i].r=a[i] ;
        for(ll i = 0;i < b.size(); ++i)
        	poly[i].i = b[i] ; 
        fft(poly);
        cd p, qtmp, q; 
        poly[0] = poly[0].r * poly[0].i ; // for i = 0
        for(ll i = 1;i < (rsz>>1)+1; ++i)
        { 
        	p=poly[i]+poly[rsz - i].conj(), qtmp=poly[rsz-i]-poly[i].conj();
            q.r=qtmp.i, q.i=qtmp.r ; poly[i] = (p * q) * 0.25;
            if(i) poly[rsz-i] = poly[i].conj();
        } 
        fft(poly,true);//add mod in line below
        vector<ll> ans(sz1-1); 
        for(ll i=0;i < ans.size(); ++i) 
        	ans[i] = (ll)(poly[i].r + 0.5) ;
        /*int cr=0; FN(i,sz(ans)) { // Uncomment for multiplication of two num
          ans[i] += cr; cr = ans[i] / 10; ans[i] %= 10;
		}*/
        return ans;
    }
}

ll dp[M];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll i,n,t,s = 1,j = 2,v,ans = 0;	

	for(i=1;i<md;++i)
	{
		s = 1ll*s*j%md;
		dp[s] = i;
	}

	vector<ll> mul(md,0);

	cin >> n;
	for(i=1;i<=n;++i)
	{
		cin >> t;
		if(t>0)
			mul[dp[t]]++;
	}

	auto res = fft::multiply(mul,mul);

	for(i=0;i<2*md-1;++i)
	{
		v = res[i];
		if(i%2 == 0)
			v -= mul[i/2];
		v = v/2;
		ans += v*pwr(2,i,md);
	}

	cout << ans << "\n";
}






Measured memory_bytes: 30580