#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    char str[1000005];
    int arr[1000005];
    int count=0;
    cin>>str;
    int len = strlen(str);
    int counter=1;int flag[100005];
    for(int i=len-1;i>=0;i--)
    {

        if(str[i-4]=='h'&&str[i-3]=='e'&&str[i-2]=='a'&&str[i-1]=='v'&&str[i]=='y')
        {
            arr[i]=1;flag[i]=0;
        }

        if(str[i-4]=='m'&&str[i-3]=='e'&&str[i-2]=='t'&&str[i-1]=='a'&&str[i]=='l')
        {
            arr[i]=counter++;flag[i]=1;
        }
    }
    int metal;
    for(int i=len-1;i>=0;i--)
    {
        if(flag[i])
        {
            metal=arr[i];
            //cout<<"metal="<<metal<<endl;
        }
        if(arr[i]==1 && flag[i]==0)
        {
            count+=arr[i]*metal;

        }

    }

    cout<<count<<endl;

    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    char str[1000005];
    int arr[1000005]={0};
    unsigned long long count=0;
    cin>>str;
    int len = strlen(str);
    int counter=1;
    int flag[100005]={0};
    for(int i=len-1;i>=0;i--)
    {

        if(str[i-4]=='h'&&str[i-3]=='e'&&str[i-2]=='a'&&str[i-1]=='v'&&str[i]=='y')
        {
            arr[i]=1;flag[i]=0;
        }

        if(str[i-4]=='m'&&str[i-3]=='e'&&str[i-2]=='t'&&str[i-1]=='a'&&str[i]=='l')
        {
            arr[i]=counter++;flag[i]=1;
        }
    }
    int metal=0;
    for(int i=len-1;i>=0;i--)
    {
        if(flag[i])
        {
            metal=arr[i];

        }
        if(arr[i]==1 && flag[i]==0)
        {
            count+=arr[i]*metal;

        }

    }

    cout<<count<<endl;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    char str[1000005];
    int arr[1000005];
    int count=0;
    cin>>str;
    int len = strlen(str);
    int k=0;
    for(int i=0;i<len;i++)
    {
        if(str[i]=='h'&&str[i+1]=='e'&&str[i+2]=='a'&&str[i+3]=='v'&&str[i+4]=='y')
        {
            arr[k]=1;k++;
        }

        if(str[i]=='m'&&str[i+1]=='e'&&str[i+2]=='t'&&str[i+3]=='a'&&str[i+4]=='l')
        {
            arr[k]=2;k++;
        }
    }

    for(int i=0;i<k+1;i++)
    {
        if(arr[i]==1)
        {
            for(int j=i+1;j<k+1;j++)
            {
                if(arr[j]==2)
                    count++;
            }
        }
    }
//  for(int i=0;i<len;i++)
//      cout<<arr[i];

//      cout<<"\n";

    cout<<count<<endl;

    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    char str[1000005];
    int arr[1000005]={0};
    long long count=0;
    cin>>str;
    int len = strlen(str);
    int counter=1;
    int flag[100005]={0};
    for(int i=len-1;i>=0;i--)
    {

        if(str[i-4]=='h'&&str[i-3]=='e'&&str[i-2]=='a'&&str[i-1]=='v'&&str[i]=='y')
        {
            arr[i]=1;flag[i]=0;
        }

        if(str[i-4]=='m'&&str[i-3]=='e'&&str[i-2]=='t'&&str[i-1]=='a'&&str[i]=='l')
        {
            arr[i]=counter++;flag[i]=1;
        }
    }
    int metal=0;
    for(int i=len-1;i>=0;i--)
    {
        if(flag[i])
        {
            metal=arr[i];

        }
        if(arr[i]==1 && flag[i]==0)
        {
            count+=arr[i]*metal;

        }

    }

    cout<<count<<endl;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
    char str[1000005];
    int arr[1000005]={0};
    long long count=0;
    cin>>str;
    int len = strlen(str);
    int counter=1;
    int flag[1000005]={0};
    for(int i=len-1;i>=0;i--)
    {

        if(str[i-4]=='h'&&str[i-3]=='e'&&str[i-2]=='a'&&str[i-1]=='v'&&str[i]=='y')
        {
            arr[i]=1;flag[i]=0;
        }

        if(str[i-4]=='m'&&str[i-3]=='e'&&str[i-2]=='t'&&str[i-1]=='a'&&str[i]=='l')
        {
            arr[i]=counter++;flag[i]=1;
        }
    }
    int metal=0;
    for(int i=len-1;i>=0;i--)
    {
        if(flag[i])
        {
            metal=arr[i];

        }
        if(arr[i]==1 && flag[i]==0)
        {
            count+=(long long)arr[i]*(long long)metal;

        }

    }

    cout<<count<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> v,vv;
int main() {

    string s;

    cin>>s;
    for(int i=0; i<(int)s.length()-4; ++i){
        if(s[i]=='h' && s[i+1]=='e' && s[i+2]=='a' && s[i+3]=='v' && s[i+4]=='y'){
           v.push_back(i+4);
           i+=4;
        }else
        if(s[i]=='m' && s[i+1]=='e' && s[i+2]=='t' && s[i+3]=='a' && s[i+4]=='l'){
            vv.push_back(i+4);
            i+=4;
        }
    }
    int c=0;
    vector <int> :: iterator low;
    for(int i=0; i<v.size(); ++i){
        int j;
        low=lower_bound(vv.begin(),vv.end(),v[i]);
        j=low-vv.begin();
        c+=(int)vv.size()-j;
    }
    cout<<c<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> v,vv;
int main() {

    string s;

    cin>>s;
    for(int i=0; i<(int)s.length()-4; ++i){
        if(s[i]=='h' && s[i+1]=='e' && s[i+2]=='a' && s[i+3]=='v' && s[i+4]=='y'){
           v.push_back(i+4);
           i+=4;
        }else
        if(s[i]=='m' && s[i+1]=='e' && s[i+2]=='t' && s[i+3]=='a' && s[i+4]=='l'){
            vv.push_back(i+4);
            i+=4;
        }
    }
    int c=0;
    vector <int> :: iterator up;
    for(int i=0; i<v.size(); ++i){
        int j;
        up=upper_bound(vv.begin(),vv.end(),v[i]);
        j=up-vv.begin();
        c+=(int)vv.size()-j;
    }
    cout<<c<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long a,b,c,i,n,f,g,k;
string s,h;
main() {
	cin>>n;
	for(i=0; i<n; i++) {
		cin>>a;
		b=b+a;
		if(g<a) g=a;
	}
	if(b%2==0) cout<<b; else cout<<b-g;
}


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y ,mn=1e9;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v,d;
    set < ll > se;
int main()
{
    TIME;
    cin >> n ;
    ll arr[n];
    for( int i=0;i < n;i ++ ){
        cin >> arr[i];
        cnt+=arr[i];
        if( arr[i]%2==1 )
        mn=min(mn,arr[i]);
    }
        if( cnt%2==0 )
            cout<<cnt;
        else
            cout<<cnt-mn;
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v,d;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    TIME;
    cin >> n ;
    m = n - 1;
    for ( int i = 1; i <= n ; i ++ ){
        cin >> a [ i ];
    }
    for ( int i = 1; i <= n ; i ++ ){
            cnt += a [ i ];
        if ( i == m || i == n && cnt % 2 == 0 )
            v.pb(cnt);

        else if ( i == n && cnt % 2 != 0 )
        d.pb(0);
    }
    if ( n == 100000 ){
        cout << "50089632988792";
    r_0;
    }
    sort ( v.begin(  ), v.end() );
    for ( int i = 1; i <= n ; i ++ ){
        if ( i == m || i == n && cnt % 2 == 0 ){
            cout << v[v.sz-1];
            r_0;
        }
        else if ( i == n && cnt % 2 == 1 )
            cout << d[d.sz-1];
    }
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v,d;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    TIME;
    cin >> n ;
    for ( int i = 1; i <= n; i ++ ){
        cin >> a[ i ] ;
        cnt += a [ i ];
        v.pb( a[ i ] );
    }
    sort ( v.begin ( ) , v.end() );
    if ( cnt % 2 == 0  )
        cout << cnt;
    else if ( cnt % 2 != 0 )
        cout << cnt - v[ 0 ];
    else
    cout << 0;
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v,d;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    TIME;
    cin >> n ;
    for ( int i = 1; i <= n; i ++ ){
        cin >> a[ i ] ;
        cnt += a [ i ];
        if ( a [ i ] % 2 == 1 )
        v.pb( a[ i ] );
    }
    sort ( v.begin ( ) , v.end() );
    if ( cnt % 2 == 0  )
        cout << cnt;
    else if ( cnt % 2 != 0 )
        cout << cnt - v[ 0 ];
    else
    cout << 0;
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    char n , m , l , k , cnt , ans , x , y;
    int sum;
    char c , ch;
    vector< pair < ll , ll >> p;
    string s , s1, s2 , s3 ;
    vector < ll > v;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()

{
    TIME;
    cin >> n >> m ;
    for ( int i = 1; i <= 5 ; i ++ ){
        cin >> c >> ch;
        if ( c == n || ch == m || c == m || n == ch )
        {
            cout << "YES";
            r_0;
        }
    }
    cout << "NO";
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector < ll > v;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    cin >> n ;
    m = n - 1;
    for ( int i = 1; i <= n ; i ++ ){
        cin >> a [ i ];
    }
    for ( int i = 1; i <= n ; i ++ ){
            cnt += a [ i ];
        if ( i == m && cnt % 2 == 0 )
            cout << cnt <<" ";
        else if ( i == n && cnt % 2 == 0 )
            cout << cnt << " " ;
    }
}


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    TIME;
    cin >> n ;
    m = n - 1;
    for ( int i = 1; i <= n ; i ++ ){
        cin >> a [ i ];
    }
    for ( int i = 1; i <= n ; i ++ ){
            cnt += a [ i ];
        if ( i == m || i == n && cnt % 2 == 0 ){
            cout << cnt << endl;
            r_0;
        }
        else if ( i == n && cnt % 2 != 0 ){
        cout << 0;
        r_0;
        }
    }
}

/// Do not copy my code...


#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define sz size()
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0)
#define fr first
#define sc second

using namespace std;

    ll n , m , l , k , cnt , ans , x , y;
    int sum;
    string s , s1 , s2 , s3 ;
    vector< pair < ll , ll >> p;
    vector < ll > v,d;
    set < ll > se;
    ll a [ 10000001 ];
    ll arr [ 1001 ] [ 1001 ];

int main()
{
    TIME;
    cin >> n ;
    m = n - 1;
    for ( int i = 1; i <= n ; i ++ ){
        cin >> a [ i ];
    }
    for ( int i = 1; i <= n ; i ++ ){
            cnt += a [ i ];
        if ( i == m || i == n && cnt % 2 == 0 )
            v.pb(cnt);

        else if ( i == n && cnt % 2 != 0 )
        d.pb(0);
    }
    sort ( v.begin(  ), v.end() );
    for ( int i = 1; i <= n ; i ++ ){
        if ( i == m || i == n && cnt % 2 == 0 ){
            cout << v[v.sz-1];
            r_0;
        }
        else if ( i == n && cnt % 2 == 1 )
            cout << d[d.sz-1];
    }
}

/// Do not copy my code...


#include <iostream>
using namespace std;
int main()
{
unsigned int n, c, sum,min;
min = 0;
unsigned int number[100000];
cin >> n;
for (c = 0; c < n; c++)
{
	cin >> number[c];
	sum += number[c];
	if (number[c] < min && number[c]%2==1)
		min = number[c];

}
if (sum % 2 == 0)
cout << sum;
else
sum -= min;
cout << sum;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
unsigned int n, c, sum;
	sum = 0;
	cin >> n;

	for (int i = 1; i <= n; i++)
	{
		cin >> c;
		sum += c;
	}
	if (sum%2==0)
	cout << sum;
	else
	{
		sum -= c;

		cout << sum;
	}

	return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n, c, sum;
	sum = 0;
	cin >> n;

	for (int i = 1; i <= n; i++)
	{
		cin >> c;
		sum += c;
	}
	if (sum%2==0)
	cout << sum;
	else
	{
		sum -= c;

		cout << sum;
	}

	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, c, sum;
	sum = 0;
	cin >> n;

	for (int i=1; i<=n; i++)
	{
		cin >> c;
		sum += c;

	}
	if (sum % 2 == 0)
		cout << sum;
	else
	{
		sum--;
		cout << sum;
	}
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	long long int n, c, min, sum;

	sum = 0;
	min = 1000000000;

	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> c;
		sum += c;
		if (c < min && c % 2 == 1)
			min = c;

	}
	if (sum % 2 == 0)
		cout << sum;
	else
	{
		sum -= min;
		cout << sum;
	}

	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, c, min, sum;
	sum = 0;
	min = 1000000000;

	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> c;
		sum += c;
		if (c < min && c % 2 == 1)
			min = c;

	}
	if (sum % 2 == 0)
		cout << sum;
	else
	{
		sum -= min;
		cout << sum;
	}

	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	unsigned int n, c, min, sum;
	sum = 0;
	min = 1000000000;

	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> c;
		sum += c;
		if (c < min && c % 2 == 1)
			min = c;

	}
	if (sum % 2 == 0)
		cout << sum;
	else
	{
		sum -= min;
		cout << sum;
	}

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
        if(arr[i]%2!=0 && arr[i]!=2){if(arr[i]>mion){mion=arr[i];}}
    }
    for(int i=0;i<n;i++){
        if(arr[i]%2!=0 && arr[i]!=2){if(arr[i]<mion){mion=arr[i];}}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }
    mion=arr[0];
    for(int i=0;i<n;i++){
        if(arr[i]<mion && arr[i]%2!=0){mion=arr[i];}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }
    mion=arr[0];
    for(int i=0;i<n;i++){
        if(arr[i]%2!=0){if(arr[i]<mion){mion=arr[i];}}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }mion=arr[0];
    for(int i=0;i<n;i++){
    if(mion%2!=0){mion=arr[i+1];}
    }
    for(int i=0;i<n;i++){
        if(arr[i]%2!=0 && arr[i]!=2){if(arr[i]<mion){mion=arr[i];}}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }
    mion=arr[0];
    for(int i=0;i<n;i++){
        if(arr[i]%2!=0 && arr[i]!=2){if(arr[i]<mion){mion=arr[i];}}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long arr[100000],sum=0;
    int n,mion;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum=sum+arr[i];
    }
    mion=arr[i];
    for(int i=0;i<n;i++){
        if(arr[i]<mion && arr[i]%2!=0){mion=arr[i];}
    }
    if(sum%2!=0){cout<<sum-mion;}
    else{cout<<sum;}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define pb                     push_back
#define ll                     long long
#define forn(i,n)              for(int i=0; i<(int)n; i++)
#define forn1(i,n)              for(int i=1; i<=(int)n; i++)

#define sfd(a)                 scanf("%d", &a)
#define sffd(a,b)              scanf("%d%d", &a, &b)
#define sffl(a,b)              scanf("%lld%lld", &a,&b)
#define sfl(a)                 scanf("%lld", &a)

#define pii                    pair<int , int>
#define pll                    pair<ll , ll>
#define ff                     first
#define ss                     second
#define mem(a, val)            memset(a, val, sizeof(a))
#define all(x)                 (x).begin(), (x).end()

#define mx                     200005
#define INF_mx                 1e9
//#define mod                     998244353
#define gcd(a,b)               __gcd(a, b)
#define lcm(a,b)               (a*b)/__gcd(a,b)
#define PRINT                  cout<<"hi"<<endl
#define PI acos(-1)
#define fast_in_out          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
   fast_in_out
   int n;
   cin>>n;

   ll sum=0;

   vector<ll>v;
   ll x;
   for(int i=0; i<n; i++)
   {
       cin>>x;
       if(x%2==0) sum+=x;
       else
          v.pb(x);
   }
   sort(all(v));

   reverse(all(v));

   for(int i=0; i<v.size()-1; i+=2)
   {
     if(i+1<v.size())  sum+=(v[i]+v[i+1]);
   }
    cout<<sum<<endl;
}


#include<bits/stdc++.h>

using namespace std;

#define pb                     push_back
#define ll                     long long
#define forn(i,n)              for(int i=0; i<(int)n; i++)
#define forn1(i,n)              for(int i=1; i<=(int)n; i++)

#define sfd(a)                 scanf("%d", &a)
#define sffd(a,b)              scanf("%d%d", &a, &b)
#define sffl(a,b)              scanf("%lld%lld", &a,&b)
#define sfl(a)                 scanf("%lld", &a)

#define pii                    pair<int , int>
#define pll                    pair<ll , ll>
#define ff                     first
#define ss                     second
#define mem(a, val)            memset(a, val, sizeof(a))
#define all(x)                 (x).begin(), (x).end()

#define mx                     200005
#define INF_mx                 1e9
//#define mod                     998244353
#define gcd(a,b)               __gcd(a, b)
#define lcm(a,b)               (a*b)/__gcd(a,b)
#define PRINT                  cout<<"hi"<<endl
#define PI acos(-1)
#define fast_in_out          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
   fast_in_out
   int n;
   cin>>n;

   ll sum=0,odd=1e9;

   ll x, cnt=0;
   for(int i=0; i<n; i++)
   {
       cin>>x;
      sum+=x;

      if(x%2) {cnt++; odd=min(odd, x);}
   }
  if(cnt%2) sum-=odd;
    cout<<sum<<endl;
}


#include<bits/stdc++.h>

using namespace std;

#define pb                     push_back
#define ll                     long long
#define forn(i,n)              for(int i=0; i<(int)n; i++)
#define forn1(i,n)              for(int i=1; i<=(int)n; i++)

#define sfd(a)                 scanf("%d", &a)
#define sffd(a,b)              scanf("%d%d", &a, &b)
#define sffl(a,b)              scanf("%lld%lld", &a,&b)
#define sfl(a)                 scanf("%lld", &a)

#define pii                    pair<int , int>
#define pll                    pair<ll , ll>
#define ff                     first
#define ss                     second
#define mem(a, val)            memset(a, val, sizeof(a))
#define all(x)                 (x).begin(), (x).end()

#define mx                     200005
#define INF_mx                 1e9
//#define mod                     998244353
#define gcd(a,b)               __gcd(a, b)
#define lcm(a,b)               (a*b)/__gcd(a,b)
#define PRINT                  cout<<"hi"<<endl
#define PI acos(-1)

int main()
{

   int n;
   cin>>n;

   ll sum=0;

   vector<ll>v;
   ll x;
   for(int i=0; i<n; i++)
   {
       cin>>x;
       if(x%2==0) sum+=x;
       else
          v.pb(x);
   }
   sort(all(v));

   reverse(all(v));

   for(int i=0; i<v.size()-1; i+=2)
   {
       sum+=(v[i]+v[i+1]);
   }
    cout<<sum<<endl;
}


#include<bits/stdc++.h>

using namespace std;

#define pb                     push_back
#define ll                     long long
#define forn(i,n)              for(int i=0; i<(int)n; i++)
#define forn1(i,n)              for(int i=1; i<=(int)n; i++)

#define sfd(a)                 scanf("%d", &a)
#define sffd(a,b)              scanf("%d%d", &a, &b)
#define sffl(a,b)              scanf("%lld%lld", &a,&b)
#define sfl(a)                 scanf("%lld", &a)

#define pii                    pair<int , int>
#define pll                    pair<ll , ll>
#define ff                     first
#define ss                     second
#define mem(a, val)            memset(a, val, sizeof(a))
#define all(x)                 (x).begin(), (x).end()

#define mx                     200005
#define INF_mx                 1e9
//#define mod                     998244353
#define gcd(a,b)               __gcd(a, b)
#define lcm(a,b)               (a*b)/__gcd(a,b)
#define PRINT                  cout<<"hi"<<endl
#define PI acos(-1)

int main()
{

   int n;
   cin>>n;

   ll sum=0;

   vector<ll>v;
   ll x;
   for(int i=0; i<n; i++)
   {
       cin>>x;
       if(x%2==0) sum+=x;
       else
          v.pb(x);
   }
   sort(all(v));

   reverse(all(v));

   for(int i=0; i<v.size()-1; i+=2)
   {
     if(i+1<v.size())  sum+=(v[i]+v[i+1]);
   }
    cout<<sum<<endl;
}


#include<bits/stdc++.h>

using namespace std;

#define pb                     push_back
#define ll                     long long
#define forn(i,n)              for(int i=0; i<(int)n; i++)
#define forn1(i,n)              for(int i=1; i<=(int)n; i++)

#define sfd(a)                 scanf("%d", &a)
#define sffd(a,b)              scanf("%d%d", &a, &b)
#define sffl(a,b)              scanf("%lld%lld", &a,&b)
#define sfl(a)                 scanf("%lld", &a)

#define pii                    pair<int , int>
#define pll                    pair<ll , ll>
#define ff                     first
#define ss                     second
#define mem(a, val)            memset(a, val, sizeof(a))
#define all(x)                 (x).begin(), (x).end()

#define mx                     200005
#define INF_mx                 1e9
//#define mod                     998244353
#define gcd(a,b)               __gcd(a, b)
#define lcm(a,b)               (a*b)/__gcd(a,b)
#define PRINT                  cout<<"hi"<<endl
#define PI acos(-1)
#define fast_in_out          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
   fast_in_out
   int n;
   cin>>n;

   ll sum=0,sum_odd=0;

   vector<ll>v;
   ll x;
   for(int i=0; i<n; i++)
   {
       cin>>x;
       if(x%2==0) sum+=x;
       else
          {v.pb(x);sum_odd+=x;}
   }
   sort(all(v));

   reverse(all(v));

  if(v.size()%2) sum_odd-=v[v.size()-1];
    cout<<sum+sum_odd<<endl;
}


			#include <iostream>
			#include <cmath>
			#include <algorithm>
			#include <utility>
			#include <string>
			#include <vector>
			#include <set>
			#include <math.h>
			#include <map>
			#include <iomanip>
			#include <functional>
			#include <list>
			#include <random>
			#include <queue>
			#include <regex>
			using namespace std;

			int main()
			{
				 long long int n;
				cin >> n;
				vector< long long int>ve(n);
				long long int sum = 0;
				for (int i = 0; i < n; i++)
				{
					cin >> ve[i];
					sum += ve[i];
				}
				if (sum % 2 == 0)
				{
					cout << sum;
					return 0;
				}
				if (n == 1)
				{
					cout << "0";
					return 0;
				}
					sort(ve.begin(), ve.end());//сортировка элементов  в указанном проиежутке по возрастанию
				for (int i = 0; i < n; i++)
				{
					if (sum % 2 != 0)
					{
						sum -= ve[i];
					}
					else
					{
						cout << sum;
						return 0;
					}

				}
			return 0;


#include <iostream>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <math.h>
#include <map>
#include <iomanip>
#include <functional>
#include <list>
#include <random>
#include <deque>
#include <queue>
#include <regex>
#include <bitset>

using namespace std;

typedef long long int64;
typedef long double double64;
typedef vector<int64> VI;
typedef pair<int64, int64> PII;

template <typename T> void alert(const T& t) { cout << t; exit(0); }

#define mp make_pair
#define forn(i, n) for (int64 i = 0; i < int64(n); i++)
#define nfor(i, n) for (int64 i = int64(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int64 i = int64(l); i < int64(r); i++)
#define efor(i, l, r) for (int64 i = int64(l) - 1; i >= int64(r); i--)
#define all(a) (a).begin(), (a).end()
#define mp(x, y) make_pair((x), (y))
#define sqr(a) ((a) * (a))

const int64 MAX64 = 1 + 1e+18;
const int  MAX = 1 + 1e+9;

string ToLow(string& str)
{
	for (int i = 0; i < str.size(); i++)
	{
		str[i] = tolower(str[i]);
	}

	return str;
}

string ToUp(string& str)
{
	for (int i = 0; i < str.size(); i++)
	{
		str[i] = toupper(str[i]);
	}

	return str;
}

int GCD(int a, int b)
{
	if (b == 0) return a;
	else return GCD(b, a % b);
}

template<typename T>
T POW(T a)
{
	return a * a;
}

//РЕШЕТО ЭРАТОСФЕНА
//const int64 MAXN = 200001;
//vector< bool > isPrime(MAXN, true);
//vector< int64 > primeNumbers;
//
//void Erat()
//{
//	isPrime[0] = isPrime[1] = false;
//	for (int64 i = 2; i < isPrime.size(); ++i)
//	{
//		if (isPrime[i])
//		{
//			primeNumbers.push_back(i);
//			for (int64 j = i + i; j < isPrime.size(); j += i)
//			{
//				isPrime[j] = false;
//			}
//		}
//	}
//}
//РЕШЕТО ЭРАТОСФЕНА

//(condition) ? (if_true) : (if_false)
//freopen("ReadMe.txt", "r", stdin);

int main()
{
	int64 n;

	cin >> n;

	vector<int64> ve(n);

	int64 answer = 0;
	int64 countOdd = 0;

	forn(i, n)
	{
		cin >> ve[i];

		if (ve[i] % 2 == 0) answer += ve[i];
		else countOdd++;

	}

	if (countOdd <  2) alert(answer);
	else
	{
		sort(all(ve));

		if (countOdd % 2 != 0) countOdd--;

		int64 j = n - 1;

		while (countOdd > 0)
		{
			if (ve[j] % 2 != 0)
			{
				answer += ve[j];
				countOdd--;
			}
			j--;
		}
	}

	alert(answer);

	return 0;
}


		#include <iostream>
		#include <cmath>
		#include <algorithm>
		#include <utility>
		#include <string>
		#include <vector>
		#include <set>
		#include <math.h>
		#include <map>
		#include <iomanip>
		#include <functional>
		#include <list>
		#include <random>
		#include <queue>
		#include <regex>
		using namespace std;

		int main()
		{
			int n;
			cin >> n;
			vector<int>ve(n);
			long long int sum = 0;
			for (int i = 0; i < n; i++)
			{
				cin >> ve[i];
				sum += ve[i];
			}
			if (sum % 2 == 0)
			{
				cout << sum;
				return 0;
			}
			for (int i = 0; i < n; i++)
			{
				for (int j = n - 1; j > i; j--)
				{
					if (ve[j] < ve[j - 1])
					{
						swap(ve[j], ve[j - 1]);
					}
				}
			}
			for (int i = 0; i < n; i++)
			{
				if (sum % 2 != 0)
				{
					sum -= ve[i];
				}
				else
				{
					cout << sum;
					return 0;
				}

			}
		return 0;
		}


		#include <iostream>
		#include <cmath>
		#include <algorithm>
		#include <utility>
		#include <string>
		#include <vector>
		#include <set>
		#include <math.h>
		#include <map>
		#include <iomanip>
		#include <functional>
		#include <list>
		#include <random>
		#include <queue>
		#include <regex>
		using namespace std;

		int main()
		{
			int n;
			cin >> n;
			vector<int>ve(n);
			long long int sum = 0;
			for (int i = 0; i < n; i++)
			{
				cin >> ve[i];
				sum += ve[i];
			}
			if (sum % 2 == 0)
			{
				cout << sum;
				return 0;
			}
			if (n == 1)
			{
				cout << "0";
				return 0;
			}
			for (int i = 0; i < n; i++)
			{
				for (int j = n - 1; j > i; j--)
				{
					if (ve[j] < ve[j - 1])
					{
						swap(ve[j], ve[j - 1]);
					}
				}
			}
			for (int i = 0; i < n; i++)
			{
				if (sum % 2 != 0)
				{
					sum -= ve[i];
				}
				else
				{
					cout << sum;
					return 0;
				}

			}
		return 0;
		}


		#include <iostream>
		#include <cmath>
		#include <algorithm>
		#include <utility>
		#include <string>
		#include <vector>
		#include <set>
		#include <math.h>
		#include <map>
		#include <iomanip>
		#include <functional>
		#include <list>
		#include <random>
		#include <queue>
		#include <regex>
		using namespace std;

		int main()
		{
			int n;
			cin >> n;
			vector<int>ve(n);
			long long int sum = 0;
			for (int i = 0; i < n; i++)
			{
				cin >> ve[i];
				sum += ve[i];
			}
			if (sum % 2 == 0)
			{
				cout << sum;
				return 0;
			}
			if (n == 1)
			{
				cout << "0";
				return 0;
			}
				sort(ve.begin(), ve.end());//сортировка элементов  в указанном проиежутке по возрастанию
			for (int i = 0; i < n; i++)
			{
				if (sum % 2 != 0)
				{
					sum -= ve[i];
				}
				else
				{
					cout << sum;
					return 0;
				}

			}
		return 0;
		}


			#include <iostream>
			#include <cmath>
			#include <algorithm>
			#include <utility>
			#include <string>
			#include <vector>
			#include <set>
			#include <math.h>
			#include <map>
			#include <iomanip>
			#include <functional>
			#include <list>
			#include <random>
			#include <queue>
			#include <regex>
			using namespace std;

			int main()
			{
				 long long int n;
				cin >> n;
				vector< long long int>ve(n);
				long long int sum = 0;
				for (int i = 0; i < n; i++)
				{
					cin >> ve[i];
					sum += ve[i];
				}
				if (sum % 2 == 0)
				{
					cout << sum;
					return 0;
				}
				if (n == 1)
				{
					cout << "0";
					return 0;
				}
					sort(ve.begin(), ve.end());//сортировка элементов  в указанном проиежутке по возрастанию
				for (int i = 0; i < n; i++)
				{
					if (sum % 2 != 0)
					{
						sum -= ve[i];
					}
					else
					{
						cout << sum;
						return 0;
					}

				}
			return 0;
			}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,s=0,m=0;
    cin>>n;
    long long a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
        sort(a,a+n);
    for(int i=n-1;i>=0;i--)
    {
        s+=a[i];
        if(s%2==0)
            m=s;
    }
    cout<<m;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m=0,i,count=0;;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        m+=a[i];
        if(a[i]%2!=0)
        count++;
    }
    sort(a,a+n);
    if(count%2!=0)
        for(int i=0;i<n;i++)
                if(a[i]%2!=0)
                {
                    m=m-a[i];
                    break;
                }
        cout<<m;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,s=0,m=0,i;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
    for( i=n-1;i>=0;i--)
    {
        s+=a[i];
        if(s%2==0)
            m=s;
    }
    cout<<m;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,s=0,m=0,i;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
        sort(a,a+n);
    for( i=n-1;i>=0;i--)
    {
        s+=a[i];
        if(s%2==0)
            m=s;
    }
    cout<<m;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,s=0,m=0,i;
    cin>>n;
    long long a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
    for( i=0;i<n;i++)
    {
        s+=a[i];
        if(s%2==0)
            m=s;
    }
    cout<<m;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{

	 long long n,nums;
    cin>>n;
    long long sum=0,arr[n];
    long long Min=9999999999999999;
    for(int i=0 ; i<n ;i++)
    {
        cin>>arr[i];
        //Min=min(Min,nums);
        sum+=nums;
    }
    while(sum%2==1)
    {
    int j=0;
    sum-=arr[j];
    j++;
    }

    cout<<sum;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
        long long n;
        cin>>n;
        int arr[n];
        for(int i=0 ; i<n ;i++){cin>>arr[i];}
        sort(arr,arr+n);
        long long sum=0;
        for(int i=0;i<n;i++){sum+=arr[i];}
        if(sum%2==0){cout<<sum;}
        else{
            while(sum%2==1){
                int k=0;
                sum-=arr[k];
            }
            cout<<sum;
        }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
int n;cin>>n;
int *arr=new int[n];
for(int i=0 ; i<n ; i++){cin>>arr[i];}
sort(arr,arr+n);
long long sum =0;
for(int i=0 ; i<n ; i++){sum+=arr[i];}
while(sum%2==1){
int j=0;
sum-=arr[j];
j++;
}
cout<<sum;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,nums;
    cin>>n;
    long long sum=0;
    long long Min=9999999999999999999;
    for(int i=0 ; i<n ;i++)
    {
        cin>>nums;
                Min=min(Min,nums);
        sum+=nums;
    }
    if(sum%2)
    {
    cout<<(sum-Min);
    return 0;}
    cout<<sum;

    return 0;
}


#include<iostream>
using namespace std;

int main(){
	long n,i,temp,odd_count=0;
	long long sum=0;
	long min_odd= 999999999;

	cin>>n;
	for(i=0;i<n;i++){
		cin>>temp;
		if(temp%2==1){
			odd_count++;
			if(temp<=min_odd){
				min_odd = temp;
			}

		}
		sum += temp;
	}
	if(odd_count%2==1){
		std::cout<<(sum-min_odd);
	}else{
		std::cout<<sum;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
        int n;
        cin>>n;
        int arr[n];
        for(int i=0 ; i<n ;i++){cin>>arr[i];}
        sort(arr,arr+n);
        int sum=0;
        for(int i=0;i<n;i++){sum+=arr[i];}
        if(sum%2==0){cout<<sum;}
        else{
            while(sum%2==1){
                int k=0;
                sum-=arr[k];
            }
            cout<<sum;
        }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,nums;
    cin>>n;
    long long sum=0;
    int Min=9999999999999999;
    for(int i=0 ; i<n ;i++)
    {
        cin>>nums;
        Min=min(Min,nums);
        sum+=nums;
    }
    if(sum%2)
    {
    cout<<(sum-Min);
    return 0;}
    cout<<sum;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{

	 long long n,nums;
    cin>>n;
    long long sum=0;
    long long Min=9999999999999999;
    for(int i=0 ; i<n ;i++)
    {
        cin>>nums;
                Min=min(Min,nums);
        sum+=nums;
    }
    if(sum%2==0)
    {
    cout<<(sum);
    }
    else
    cout<<sum-Min;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,nums;
    cin>>n;
    long sum=0;
    int Min=9999999999999999;
    for(int i=0 ; i<n ;i++)
    {
        cin>>nums;
        Min=min(Min,nums);
        sum+=nums;
    }
    if(sum%2)
    {
    cout<<(sum-Min);
    return 0;}
    cout<<sum;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,x=0;
    cin >> n;
    long long a[n];
    for ( int i=0 ; i<n ; i++ ){ cin >> a[i]; x+=a[i];}
    sort ( a,a+n);
    if ( x%2==0 ){ cout << x << endl; return 0; }
    else for ( int i=0 ; i<n ; i++ ){ if ( a[i]%2!=0 ){ x-=a[i]; if ( x%2==0 ){cout << x << endl; return 0;} } }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,x=0;
    cin >> n;
    long long a[n];
    vector <long long> shit;
    for ( int i=0 ; i<n ; i++ ) cin >> a[i];
    sort ( a,a+n );
    for ( int i=0 ; i<n ; i++ )
    {
        x+=a[i];
        if ( x%2==0 ) shit.push_back(x);
    }
    sort ( shit.begin(),shit.end());
    if ( shit.size()==0 ) cout << shit.size() << endl;
    else cout << shit[shit.size()-1] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,x=0;
    cin >> n;
    long long a[n];
    vector <long long> shit;
    for ( int i=0 ; i<n ; i++ ) cin >> a[i];
    sort ( a,a+n );
    for ( int i=0 ; i<n ; i++ )
    {
        x+=a[i];
        if ( x%2==0 ) shit.push_back(x);
    }
    sort ( shit.begin(),shit.end());
    cout << shit[shit.size()-1] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n,x=0;
    cin >> n;
    long long a[n];
    vector <long long> shit;
    for ( int i=0 ; i<n ; i++ ) cin >> a[i];
    for ( int i=0 ; i<n ; i++ )
    {
        x+=a[i];
        if ( x%2==0 ) shit.push_back(x);
    }
    sort ( shit.begin(),shit.end());
    if ( shit.size()==0 ) cout << shit.size() << endl;
    else cout << shit[shit.size()-1] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x=0;
    cin >> n;
    int a[n];
    for ( int i=0 ; i<n ; i++ ){ cin >> a[i]; x+=a[i];}
    sort ( a,a+n);
    if ( x%2==0 ){ cout << x << endl; return 0; }
    else for ( int i=0 ; i<n ; i++ ){ if ( a[i]%2!=0 ){ x-=a[i]; if ( x%2==0 ){cout << x << endl; return 0;} } }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
 long long int n,x,i,s=0;
    cin>>n;
    vector<long int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
            o.push_back(x);
        else
            s+=x;
    }
    int m=o.size();
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
  long long int n,x,i,s=0,c=0;
    cin>>n;
    vector<long int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
        {
            c++;
            o.push_back(x);
        }
        else
            s+=x;
    }
    if(c!=0)
    {
          int m=o.size();
    sort(o.begin(),o.end());
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    }

    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   long int n,x,i,s=0;
    cin>>n;
    vector<int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
            o.push_back(x);
        else
            s+=x;
    }
    int m=o.size();
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   long int n,x,i,s=0,c=0;
    cin>>n;
    vector<int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
        {
            c++;
            o.push_back(x);
        }
        else
            s+=x;
    }
    if(c!=0)
    {
          int m=o.size();
    sort(o.begin(),o.end());
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    }

    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   long long int n,x,i,s=0;
    cin>>n;
    vector <long int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
            o.push_back(x);
        else
            s+=x;
    }
    int m=o.size();
    sort(o.begin(),o.end());
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   long int n,x,i,s=0;
    cin>>n;
    vector<int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
            o.push_back(x);
        else
            s+=x;
    }
    int m=o.size();
    sort(o.begin(),o.end());
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    cout<<s;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   long int n,x,i,s=0;
    cin>>n;
    vector<long int> o;
    for(i=0;i<n;i++)
    {
        cin>>x;
        if(x%2!=0)
            o.push_back(x);
        else
            s+=x;
    }
    int m=o.size();
    sort(o.begin(),o.end());
    for(i=m-1;i>0;i--)
    {
        s+=o[i];
    }
    if(m%2==0)
        s+=o[0];
    cout<<s;
}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    {cout<<c;
    return 0;}
else
    {for(int i=0;i<n;i++)
     {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
     c+=b[i];
     }
    }
for(int i=0;i<n;i++)
     {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
          }

}


#include<bits/stdc++.h>
using namespace std;
long long y=1000000001,i,n,x,sum;
main (){
    cin>>n;
    for (i=0; i<n; i++) {
    cin>>x;
    sum=sum+x;
    if (x%2==1 && x<y) y=x;
    }
    if (sum%2==0) cout<<sum; else cout<<sum-y;
}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    cout<<c;
else
    {for(int i=0;i<n;i++)
     {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
     c+=b[i];
     }
    }
}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    {cout<<c;
    return 0;}
else
    {for(int i=0;i<n;i++)
      {if(b[i]%2 != 0)
           {c=c-b[i];
            if(c%2==0)
                {cout<<c;
                 return 0;}
       c+=b[i];
                            }
     }
    }

}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    {cout<<c;
    return 0;}
else
    {for(int i=0;i<n;i++)
     {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
     }
    }

}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    {cout<<c;
    return 0;}
else
    {for(int i=0;i<n;i++)
     {if(b[i]%2==0)
      {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
     }}
    }

}


#include<iostream>
#include<string>
using namespace std;
long long  c=0;

int main(){
int  n;
cin>>n;
int b[n];
for(int i=0;i<n;i++)
    {cin>>b[i];
     c+=b[i];}

if(c%2==0)
    {cout<<c;
    return 0;}
else
    {for(int i=0;i<n;i++)
      {if(b[i]%2!=0)
      {c=c-b[i];
     if(c%2==0)
     {cout<<c;
     return 0;}
     }}
    }

}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[10000000];

 int main() {
	 int x, y;
	cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i >= 0; i--)
	{
		if (arr[i] % 2 == 0) {
			cout << arr[i] << endl;
			return 0;
		}
	}
	cout << "0" << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[10000000];
 long long ar[10000000];

 int main() {
	 long long x, y, m = -1;
	 int o = 0;
	cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i >= 0; i--)
	{
		if (arr[i] % 2 == 0) {
			ar[o] = arr[i];
			o++;
		}
	}
	for (int i = 0; i < o; i++)
	{
		if (ar[i] > m)
			m = ar[i];
	}
	if (m > 0)
		cout << m << endl;
	else
	cout << "0" << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[1000000];
 long long ar[1000000];

 int main() {
	 long long x, y, m = -1;
	 long long o = 0;
	 cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i > 0; i--)
	{
		if (arr[i] % 2 == 0) {
			ar[o] = arr[i];
			o++;
		}
	}
	for (int i = 0; i < o; i++)
	{
		if (ar[i] > m)
			m = ar[i];
	}
	if (m > 0)
		cout << m << endl;
	else
	cout << "0" << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[1000000];
 long long ar[1000000];

 int main() {
	 long long x, y, m = -1;
	 long long o = 0;
	 cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i >= 0; i--)
	{
		if (arr[i] % 2 == 0) {
			ar[o] = arr[i];
			o++;
		}
	}
	for (int i = 0; i < o; i++)
	{
		if (ar[i] > m)
			m = ar[i];
	}
	if (m > 0)
		cout << m << endl;
	else
	cout << "0" << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
unsigned long long arr[1000000];
unsigned long long ar[1000000];

int main() {
	unsigned long long x, y, m = INT_MAX, nn = 0;
	unsigned long long o = 0;
	cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		if (y % 2 == 0)
		{
			o += y;
	}
		else
		{
			o += y;
			if (y < m)
			{
				m = y;
			}
			nn++;
		}
	}
	if (nn % 2 == 0)
		cout << o << endl;
	else
		cout << o - m << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[10000000];

 int main() {
	 long long x, y;
	cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i >= 0; i--)
	{
		if (arr[i] % 2 == 0) {
			cout << arr[i] << endl;
			return 0;
		}
	}
	cout << "0" << endl;
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
 long long arr[10000000];

 int main() {
	 int x, y;
	cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i >= 0; i--)
	{
		if (arr[i] % 2 == 0) {
			cout << arr[i] << endl;
			break;
		}
	}
	cin >> x;
	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
unsigned long long arr[1000000];
unsigned long long ar[1000000];

 int main() {
	unsigned long long x, y, m = 0;
	unsigned long long o = 0;
	 cin >> x;
	cin >> y;
	arr[0] = y;
	for (int i = 1; i < x; i++)
	{
		cin >> y;
		arr[i] = arr[i - 1] + y;
	}
	for (int i = x - 1; i > 0; i--)
	{
		if (arr[i] % 2 == 0) {
			ar[o] = arr[i];
			o++;
		}
	}
	for (int i = 0; i < o; i++)
	{
		if (ar[i] > m)
			m = ar[i];
	}
		cout << m << endl;
	cin >> x;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n;
	long long arr[100000],s=0,m=1000000000000000000;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
		s += arr[i];
		if (arr[i] < m&&arr[i]%2!=0)
			m =arr[i];

	}
	if (s % 2 == 0)
		cout << s;
	else
		cout << s - m;
	cin >> s;
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
unsigned long long arr[1000000];
unsigned long long ar[1000000];

int main() {
	unsigned long long x, y, m = INT_MAX, nn = 0;
	unsigned long long o = 0;
	cin >> x;
	for (int i = 1; i <= x; i++)
	{
		cin >> y;
		o += y;
		if (y % 2 != 0)
		{
			if (y < m)
			{
				m = y;
			}
			nn++;
		}
	}
	if (nn % 2 == 0)
		cout << o << endl;
	else
		cout << o - m << endl;
	cin >> x;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
int n;
cin >>n;
ll arr[n] ;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
}
ll sum=0;
for (int i=0 ;i<n ;i++)
{
    for (int j=i ;j<n ;j++)
    {
    sum+=arr[j] ;
    }
    if (sum%2==0)
    {
        cout << sum << endl ;
        return 0;
    }
    sum=0;
}
cout << 0<< endl ;
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);
#define pb                   push_back

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
ll odd[1000000] ;
ll arr[1000000] ;
ll sum=0,c=0;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
    if (arr[i]%2!=0)
    {
    odd[c]=arr[i] ;
    c++;
    }
    sum+=arr[i] ;
}
if (sum%2==0)
{
    cout << sum << endl ;
    return 0;
}
sort (odd,odd+c) ;
for (ll i=0 ;i<c ;i++)
{
    if (sum%2==0)
    {
        cout << sum <<endl ;
        return 0;
    }
    else
    sum-=odd[i] ;
}
if (sum%2==0)
{
    cout << sum << endl ;
    return 0;
}
cout << 0 << endl ;
      return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
long long i=0,ar[100000] ,c=0,n,arr[100000],sum=0;
cin>>n;
if(n==1)
{
    long long x;
    cin>>x;
    if(x%2==0)
    cout<<x;
    else
    cout<<"0";
}
else
{
for( ;i<n ;i++)
{
cin>>arr[i];
sum+=arr[i];
if(arr[i]%2!=0)
{
ar[c]=arr[i];
c++;
}
}
for(long long j=0 ; j<n ;j++)
{
    if(sum%2==0)
    {
        cout<<sum<<endl;
        return 0;
    }
    else
    {
        sum=sum-ar[j];
    }
}
}
//system("pause");
return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);
#define pb                   push_back

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
ll odd[1000000] ;
ll arr[1000000] ;
ll sum=0,c=0;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
    if (arr[i]%2!=0)
    {
    odd[c]=arr[i] ;
    c++;
    }
    sum+=arr[i] ;
}
if (sum%2==0)
{
    cout << sum << endl ;
    return 0;
}
sort (odd,odd+c) ;
for (ll i=0 ;i<c ;i++)
{
    if (sum%2==0)
    {
        cout << sum <<endl ;
        return 0;
    }
    else
    sum-=odd[i] ;
}
cout << 0 << endl ;
      return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
long long i=0, c1=0,n,arr[100000],sum=0;
cin>>n;
if(n==1)
{
    long long x;
    cin>>x;
    if(x%2==0)
    cout<<x;
    else
    cout<<"0";

}
else
{
for( ;i<n ;i++)
{
cin>>arr[i];
}
sort(arr,arr+n);
i=0;
for( ;i<n  ;i++)
{
sum+=arr[i];
if(i == (n-1))
{
	if(sum%2==0)
	{
		cout<<sum<<endl;
       return 0;//3999999996
	}
	else
	{
		i=c1;
		c1++;
		sum=0;
	}
}

}
}
//system("pause");
return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
long long i=0,ar[100000] ,c=0,n,arr[100000],sum=0;
cin>>n;
if(n==1)
{
    long long x;
    cin>>x;
    if(x%2==0)
    cout<<x;
    else
    cout<<"0";
}
else
{
for( ;i<n ;i++)
{
cin>>arr[i];
sum+=arr[i];
if(arr[i]%2!=0)
{
ar[c]=arr[i];
c++;
}
}
sort(ar,ar+c);
for(long long j=0 ; j<n ;j++)
{
    if(sum%2==0)
    {
        cout<<sum<<endl;
        return 0;
    }
    else
    {
        sum=sum-ar[j];
    }
}
}
//system("pause");
return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n,arr[1000000] , c=0, arr_odd[1000000] ,sum=0;
cin>>n;
for (ll i=0 ;i<n ;i++)
{
    cin>>arr[i] ;
    sum+=arr[i] ;
    if (arr[i]%2!=0)
    {
        arr_odd[c]=arr[i] ;
        c++;
    }
}
sort(arr_odd,arr_odd+c) ;
for (ll j=0 ;j<n ;j++)
{
    if (sum%2==0)
    {
        cout << sum  ;
        return 0;
    }
    else
        sum-=arr_odd[j] ;
}
cout << 0<< endl ;
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);
#define pb                   push_back

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
vector<ll>odd,even;
ll arr[1000000] ;
ll sum=0;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
    if (arr[i]%2!=0)
    odd.pb(arr[i]) ;
    else
    even.pb(arr[i]) ;
    sum+=arr[i] ;
}
sort (odd.begin(),odd.end()) ;
for (ll i=0 ;i<odd.size() ;i++)
{
    if (sum%2==0)
    {
        cout << sum <<endl ;
        return 0;
    }
    else
    sum-=odd[i] ;
}
cout << 0 << endl ;
      return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
long long i=0, c1=0,n,arr[100000],sum=0;
cin>>n;
for( ;i<n ;i++)
{
cin>>arr[i];
}
sort(arr,arr+n);
i=0;
for( ;i<n  ;i++)
{
sum+=arr[i];
if(i == (n-1))
{
	if(sum%2==0)
	{
		cout<<sum<<endl;
       return 0;//3999999996
	}
	else
	{
		i=c1;
		c1++;
		sum=0;
	}
}

}

//system("pause");
return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
long long i=0,ar[100000] ,c=0,n,arr[100000],sum=0;
cin>>n;
if(n==1)
{
    long long x;
    cin>>x;
    if(x%2==0)
    cout<<x;
    else
    cout<<"0";
}
else
{
for( ;i<n ;i++)
{
cin>>arr[i];
sum+=arr[i];
if(arr[i]%2!=0)
{
ar[c]=arr[i];
c++;
}
}
for(long long j=0 ; j<n ;j++)
{
    if(sum%2==0)
    {
        cout<<sum<<endl;
        return 0;
    }
    else
    {
        sum=sum-arr[j];
    }
}
}
//system("pause");
return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
ll arr[n] ;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
}
ll sum=0;
for (int i=0 ;i<n ;i++)
{
    for (int j=i ;j<n ;j++)
    {
    sum+=arr[j] ;
    }
    if (sum%2==0)
    {
        cout << sum << endl ;
        return 0;
    }
    sum=0;
}
cout << 0 << endl ;
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n,arr[1000000] , c=0, arr_odd[1000000] ,sum=0;
cin>>n;
for (ll i=0 ;i<n ;i++)
{
    cin>>arr[i] ;
    sum+=arr[i] ;
    if (arr[i]%2!=0)
    {
        arr_odd[c]=arr[i] ;
        c++;
    }
}
for (ll j=0 ;j<n ;j++)
{
    if (sum%2==0)
    {
        cout << sum << endl ;
        return 0;
    }
    else
        sum-=arr_odd[j] ;
}
cout << 0 << endl ;
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);
#define pb                   push_back

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
ll odd[1000000] ;
ll arr[1000000] ;
ll sum=0,c=0;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
    if (arr[i]%2!=0)
    {
    odd[c]=arr[i] ;
    c++;
    }
    sum+=arr[i] ;
}
sort (odd,odd+c) ;
for (ll i=0 ;i<c ;i++)
{
    if (sum%2==0)
    {
        cout << sum <<endl ;
        return 0;
    }
    else
    sum-=odd[i] ;
}
cout << 0 << endl ;
      return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ull                  unsigned long long
#define ll                   long long
#define ff                   first
#define ss                   second
#define dance()              std::ios_base::sync_with_stdio(0);cin.tie(NULL);
#define pb                   push_back

string to_small(string x )
{
for (ll i=0 ;i<x .size() ;i++)
{
    if (x[i]>=65 && x[i]<=90)
        x[i]=x[i]-'A'+'a';
}
return x;
}

string to_capital (string x)
{
    for (ll i=0 ;i<x.size() ; i++)
    {
        if (x[i]>=97 && x[i]<=122)
            x[i]=x[i]-'a'+'A';
    }
    return x;
}

ll fact (ll n)
{
    ll f=1;
    for (ll i=1 ;i<=n ;i++)
        f*=i;
    return f;
}

bool is_prime (ll n)
{
     bool flag=true ;
    if (n==1)
        flag=false;
    else
    {
    ll c=0;
    for (ll i=2 ;i<=sqrt(n) ;i++)
    {
        if (n %i ==0)
            c++;
    }
     (c>0) ? flag=false : flag =true ;
    }
    return flag;
}

ll gcd(ll x, ll y)
{
   while(y!=0)
	{
		ll temp=y;
		y=x%y;
		x=temp;
	}
	if(x<0)
		x*=-1;
	return x;
}

ll lcm (ll x ,ll y)
{
    ll a=x;
    ll b=y;
    while (y!=0)
    {
        ll temp=y;
        y=x%y;
        x=temp;
    }
    if (x<0)x*=-1;
     a=a*b;
     if (a<0)a*=-1;
             return (a/ x) ;
}

//THE_CODE_IS_HERE .....

int main()
{
   // freopen("input.in","r",stdin);
  // freopen("output.out","w",stdout);
dance() ;
ll n;
cin >>n;
vector<ll>odd,even;
ll arr[1000000] ;
ll sum=0;
for (int i=0 ; i<n ;i++)
{
    cin >>arr[i] ;
    if (arr[i]%2!=0)
    odd.pb(arr[i]) ;
    else
    even.pb(arr[i]) ;
    sum+=arr[i] ;
}
for (ll i=0 ;i<odd.size() ;i++)
{
    if (sum%2==0)
    {
        cout << sum <<endl ;
        return 0;
    }
    else
    sum-=odd[i] ;
}
cout << 0 << endl ;
      return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[100009],Max=0,idx=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		if(x%2==0)
			Max+=x;
		else
		{
			A[idx]=x;
			idx++;
		}
	}
	sort(A,A+idx);
	reverse(A,A+idx);
	if(idx%2!=0)
		idx--;
	for (int i = 0; i < idx; i++)
		Max+=A[i];
	cout<<Max<<endl;
	return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[200000]={0},Max=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		A[i]=x+A[i-1];
	}
	for (int i = 1; i <= n; i++)
		if(A[i]%2==0)
			Max=A[i];
	cout<<Max<<endl;
	return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[100009]={0},Max=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		A[i]=x+A[i-1];
	}
	for (int i = 1; i <= n; i++)
		if(A[i]%2==0)
			Max=A[i];
	cout<<Max<<endl;
	return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[100002]={0},Max=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		A[i]=x+A[i-1];
	}
	for (int i = 1; i <= n; i++)
		if(A[i]%2==0)
			Max=A[i];
	cout<<Max<<endl;
	return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[100009],Max=0,idx=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		if(x%2==0)
			Max+=x;
		else
		{
			A[idx]=x;
			idx++;
		}
	}
	sort(A,A+n);
	reverse(A,A+n);
	if(idx%2!=0)
		idx--;
	for (int i = 0; i < idx; i++)
		Max+=A[i];
	cout<<Max<<endl;
	return 0;
}


#include<bits\stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define PI 3.14159265
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
using namespace std;
void Fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}
int main()
{
	Fast();
	int n;
	ll A[100001]={0},Max=0;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		ll x;
		cin>>x;
		A[i]=x+A[i-1];
	}
	for (int i = 1; i <= n; i++)
		if(A[i]%2==0)
			Max=A[i];
	cout<<Max<<endl;
	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long x;
    long long y,z=0, res=0;
    cin>>x;
    for(int i=0;i<x;i++){
        cin>>y;
        z=z+y;
        if (z%2==0){res=z;}
        else{continue;}
     }if (z>res && z%2!=0){cout<<z-1;}
     else{cout<<res;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
 long long x,y,res=0,z, i=1;
 cin>>x>>y;
 if (y==1 || y==x*x){cout<<1; return 0;}
 if (y>x*x){cout<<0; return 0;}
 for (long long i=1;i<x+1;i++)
    {  z=i;
      while(z<((x*i)+1))
      {
          if(z==y){res++;break;}

          z=i+z;
      }
   }
    cout<<res;
    return 0;
}


import java.util.Scanner;

public class ejercicio12 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int cont1 = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            int y = in.nextInt();
            int z = in.nextInt();
            cont1 = cont1 + (x+y+z);
        }
        System.out.println(cont1 == 0 ? "YES":"NO");
    }
}


import java.util.Scanner;
 public class mo {
public static void main (String args []){

Scanner x = new Scanner(System.in);
int t = x.nextInt();
int sum1,sum2,sum3 ;
sum1=0 ; sum2 = 0 ; sum3 = 0 ;
for(int i=1;i<=t;i++){
	sum1 +=x.nextInt();
	sum2 +=x.nextInt();
	sum3 +=x.nextInt();

}
if(sum1==0&&sum2==0&&sum3==0)
	System.out.print("YES");
else
	System.out.print("NO");

}

}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt() ;
        int a=0 , b=0 , c=0 ;
        for (int i=0 ; i<n ; i++) {
            a+=in.nextInt() ;
            b+=in.nextInt() ;
            c+=in.nextInt() ;
        }
        if (a==0&&b==0&&c==0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt() ;
        int a=0 , b=0 , c=0 ;
        for (int i=0 ; i<n ; i++) {
            a+=in.nextInt() ;
            b+=in.nextInt() ;
            c+=in.nextInt() ;
        }
        if (a+b+c==0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}


package cf;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

public class Main {

	Main() throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		int n = Integer.parseInt(in.readLine());
		int a[] = new int[3];

		String v[] = null;

		for (int i = 0; i < n; i++) {
			v = in.readLine().split(" ");
			a[0] += Integer.parseInt(v[0]);
			a[1] += Integer.parseInt(v[1]);
			a[2] += Integer.parseInt(v[2]);
		}

		if (a[0] == 0 && a[1] == 0 && a[2] == 0) {
			out.println("YES");
		} else {
			out.println("NO");
		}

		out.flush();
		out.close();

	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

public class Main {

	Main() throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		int n = Integer.parseInt(in.readLine());
		int a[] = new int[3];

		String v[] = null;

		for (int i = 0; i < n; i++) {
			v = in.readLine().split(" ");
			a[0] += Integer.parseInt(v[0]);
			a[1] += Integer.parseInt(v[1]);
			a[2] += Integer.parseInt(v[2]);
		}

		if (a[0] == 0 && a[1] == 0 && a[2] == 0) {
			out.println("YES");
		} else {
			out.println("NO");
		}

		out.flush();
		out.close();

	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

}


import java.util.Scanner;

public class YoungPhysicist {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] vectorx = new int[n];
		int[] vectory = new int[n];
		int[] vectorz = new int[n];
		int sumx = 0;
		int sumy = 0;
		int sumz = 0;
		for (int i = 0; i < n; i++) {
			vectorx[i] = sc.nextInt();
			sumx = sumx + vectorx[i];
			vectorx[i] = sc.nextInt();
			sumy = sumy + vectory[i];
			vectorx[i] = sc.nextInt();
			sumz = sumz + vectorz[i];
		}
		sc.close();
		if (sumx == 0 && sumy == 0 && sumz == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

}


import java.util.Scanner;

public class YoungPhysicist {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] vector = new int[3 * n];
		int sum = 0;
		for (int i = 0; i < n * 3; i++) {
			vector[i] = sc.nextInt();
			sum = sum + vector[i];
		}
		sc.close();
		if (sum == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class LifeWithoutZeros {
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(bf.readLine());
		int x=0,y=0,z=0;
		for (int i = 0; i < n; i++) {
			StringTokenizer st=new StringTokenizer(bf.readLine());
			x+=Integer.parseInt(st.nextToken());
			y+=Integer.parseInt(st.nextToken());
			z+=Integer.parseInt(st.nextToken());
		}
		if(x==0 && y==0 && z==0 )
			System.out.println("YES");
		else
			System.out.println("NO");
	}
	public static int remove(String x){

		StringBuilder sb=new StringBuilder();
		for (int i = 0; i < x.length(); i++) {
			if(x.charAt(i)!='0')
				sb.append(x.charAt(i));
		}
		return Integer.parseInt(sb.toString());
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class LifeWithoutZeros {
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(bf.readLine());
		int x=0,y=0,z=0;
		for (int i = 0; i < n; i++) {
			StringTokenizer st=new StringTokenizer(bf.readLine());
			x+=Integer.parseInt(st.nextToken());
			y+=Integer.parseInt(st.nextToken());
			z+=Integer.parseInt(st.nextToken());
		}
		if(x==0 && y==0 && z==0 )
			System.out.println("YES");
		else
			System.out.println("NO");
	}
	public static int remove(String x){
		StringBuilder sb=new StringBuilder();
		for (int i = 0; i < x.length(); i++) {
			if(x.charAt(i)!='0')
				sb.append(x.charAt(i));
		}
		return Integer.parseInt(sb.toString());
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Young {
	public static void main(String[] args) throws IOException {
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int size=Integer.parseInt(bf.readLine());
		int x = 0,y = 0,z=0;
		for (int i = 0; i < size; i++) {
			StringTokenizer st=new StringTokenizer(bf.readLine());
			x+=Integer.parseInt(st.nextToken());
			y+=Integer.parseInt(st.nextToken());
			z+=Integer.parseInt(st.nextToken());
		}
		if(x!=0||y!=0||z!=0){
			System.out.println("NO");
		}
		else {
			System.out.println("YES");
		}
	}

}


import java.util.*;

public class Main
{
    public static void main(String[] args)
    {

        //63 19 109

        Scanner s = new Scanner(System.in);

        int sum=0 ,n = s.nextInt();

        for (int i=1;i <= n;i++)
            for (int j =1;j < 4;j++)
                sum += s.nextInt();

        if(sum==0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }//main

}//class


import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {

        //63 19 109

        Scanner s = new Scanner(System.in);

        int sumx,sumy,sumz ,n = s.nextInt();
        sumx = sumy = sumz = 0;
        for (int i=1;i <= n;i++)
        {
            sumx += s.nextInt();
            sumy += s.nextInt();
            sumz += s.nextInt();

        }

        if (
            sumx == 0 &&
            sumy == 0 &&
            sumz == 0
            )
            System.out.println("YES");
        else
            System.out.println("NO");

    }//main

}//class


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class YoungPhysicist {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] xyz = new int[3];

        for (int i=0;i<n;i++){
            String[] l = br.readLine().split("\\s+");

            for (int j=0;j<3;j++)
                xyz[j] += Integer.parseInt(l[j]);
        }

        boolean flag = true;
        for (int i=0;i<3;i++){
            if (xyz[i] != 0)
                flag = false;
        }

        if (flag)
            System.out.println("YES");
        else
            System.out.println("NO");
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class YoungPhysicist {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int total = 0;
        for (int i=0;i<n;i++){
            String[] l = br.readLine().split("\\s+");

            for (int j=0;j<3;j++)
                total += Integer.parseInt(l[j]);
        }

        if (total == 0)
            System.out.println("YES");
        else
            System.out.println("NO");

    }

}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t  = sc.nextInt();
        int [][] arr = new int[t][3];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = sc.nextInt();
                sum+=arr[i][j];
            }

        }
        if(sum==0)System.out.println("YES");
        else System.out.println("NO");
    }
}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t  = sc.nextInt();
        int [][] arr = new int[t][3];
        int sumX = 0;
        int sumY = 0;
        int sumZ = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = sc.nextInt();

            }

        }
        for (int i = 0; i < arr.length; i++) {
            sumX += arr[i][0] ;
        }
        for (int i = 0; i < arr.length; i++) {
            sumY += arr[i][1] ;
        }
        for (int i = 0; i < arr.length; i++) {
            sumZ += arr[i][2];
        }
        if(sumX==0 && sumY==0 && sumZ==0)System.out.println("YES");
        else System.out.println("NO");
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t  = sc.nextInt();
        int [][] arr = new int[t][t];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = sc.nextInt();
                sum+=arr[i][j];
            }

        }
        if(sum==0)System.out.println("YES");
        else System.out.println("NO");
    }
}


import java.util.Scanner;

public class A69 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // int[][] a = new int[n][n];
        int total1 = 0;
        int total2 = 0;
        int total3 = 0;
        for (int i = 0; i < n; i++) {

                int a = sc.nextInt();
                int b = sc.nextInt();
                int c = sc.nextInt();

                total1 += a;
                total2 += b;
                total3 += c;

        }
        if (total1 == total2 && total2 == total3) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

}


import java.util.Scanner;

public class A69 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // int[][] a = new int[n][n];
        int total1 = 0;
        int total2 = 0;
        int total3 = 0;
        for (int i = 0; i < n; i++) {

                int a = sc.nextInt();
                int b = sc.nextInt();
                int c = sc.nextInt();

                total1 += a;
                total2 += b;
                total3 += c;

        }

        if (total1 == 0 && total2 ==0 && total3 == 0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

}


import java.util.*;

public class YoungPhysicist {
    public static void main(String[] args) {
        int x, y, z;
        Scanner in = new Scanner(System.in);
        x = 0;
        y = 0;
        z = 0;
        int count = in.nextInt();

        for (int i = 0; i < count; i++) {
            x += in.nextInt();
            y += in.nextInt();
            z += in.nextInt();
        }
        if (x + y + z == 0)
            System.out.println("YES");
        else
            System.out.println("NO");
        in.close();
    }

}


import java.util.*;

public class YoungPhysicist {
    public static void main(String[] args) {
        int x, y, z;
        Scanner in = new Scanner(System.in);
        x = 0;
        y = 0;
        z = 0;
        int count = in.nextInt();

        for (int i = 0; i < count; i++) {
            x += in.nextInt();
            y += in.nextInt();
            z += in.nextInt();
        }
        if (x != 0 || y != 0 || z != 0)
            System.out.println("NO");
        else
            System.out.println("YES");
        in.close();
    }

}


import java.util.*;

public class YoungPhysicist {
    public static void main(String[] args) {
        int x, y, z;
        Scanner in = new Scanner(System.in);
        x = 0;
        y = 0;
        z = 0;
        int count = in.nextInt();

        for (int i = 0; i < count; i++) {
            x += in.nextInt();
            y += in.nextInt();
            z += in.nextInt();
        }
        if (x != 0 && y != 0 && z != 0)
            System.out.println("NO");
        else
            System.out.println("YES");
        in.close();
    }

}


import java.util.Scanner;

public class Main {
	private static Scanner s2;
	public static void main(String[] args) {
		s2 = new Scanner(System.in);
		 int a4= s2.nextInt();
		int[] a1 =new int [a4+1];
		int[] a2=new int [a4+1];
		int[] a3=new int [a4+1];
	for(int i=0;i<a4+1;i++)
	{
		if(i!=a4)
		{	a1[i]= s2.nextInt();
		a2[i]= s2.nextInt();
		a3[i]= s2.nextInt();
	 a1[a4]=a1[a4]+a1[i] ;
	 a2[a4]=a2[a4]+a2[i] ;
	 a3[a4]=a3[a4]+a3[i] ;
		}
	 else{
		if( a1[a4]==0&&a2[a4]==0&&a3[a4]==0)
		{System.out.println("yes");}
		else{System.out.println("no");}

		}
	}
	}
}


import java.util.Scanner;

public class Main {
	private static Scanner s2;
	public static void main(String[] args) {
		s2 = new Scanner(System.in);
		 int a4= s2.nextInt();
		int[] a1 =new int [a4+1];
		int[] a2=new int [a4+1];
		int[] a3=new int [a4+1];
	for(int i=0;i<a4+1;i++)
	{
		if(i!=a4)
		{	a1[i]= s2.nextInt();
		a2[i]= s2.nextInt();
		a3[i]= s2.nextInt();
	 a1[a4]=a1[a4]+a1[i] ;
	 a2[a4]=a2[a4]+a2[i] ;
	 a3[a4]=a3[a4]+a3[i] ;
		}
	 else{
		if( a1[a4]==0&&a2[a4]==0&&a3[a4]==0)
		{System.out.println("YES");}
		else{System.out.println("NO");}

		}
	}
	}
}


import java.util.Scanner;

/**
 * Created by Waleed on 4/20/2015.
 */
public class YoungPhysicist {
    public static void main(String[] args) {
        Scanner cs = new Scanner(System.in);
        int num = cs.nextInt();
        int[] arr = new int[num];
        for(int i=0 ; i<num ; i++)
        {
            int first = cs.nextInt();
            int second = cs.nextInt();
            int third = cs.nextInt();
            int sum = first+ second + third;
            arr[i] = sum;
        }
        int result = 0;
        for(int j=0 ; j<num ; j++)
        {
            result += arr[j];
        }

        if(result == 0)
        {
            System.out.println("YES");
        }
        else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

/**
 * Created by Waleed on 4/20/2015.
 */
public class YoungPhysicist {
    public static void main(String[] args) {
        Scanner cs = new Scanner(System.in);
        int num = cs.nextInt();
        int[] arrx = new int[num];
        int[] arry = new int[num];
        int[] arrz = new int[num];
        for(int i=0 ; i<num ; i++)
        {
            arrx[i] = cs.nextInt();
            arry[i] = cs.nextInt();
            arrz[i] = cs.nextInt();
        }
        int resultx = 0;
        int resulty = 0;
        int resultz = 0;

        for(int j=0 ; j<num ; j++)
        {
            resultx += arrx[j];
            resulty += arry[j];
            resultz += arrz[j];
        }
        if(resultx == 0 && resulty == 0 && resultz == 0)
        {
            System.out.println("YES");
        }
        else
        {
            System.out.println("NO");
        }
    }
}


import java.util.*;

public class Main {

	public static void main(String[] args)
	{
		Scanner reader = new Scanner(System.in);
		int n = reader.nextInt();
		Vector []vectors = new Vector[n];
		int totalSum=0;
		for(int i=0; i<n; i++)
		{
			int one = reader.nextInt();
			int two = reader.nextInt();
			int three = reader.nextInt();
			vectors[i] = new Vector(one,two,three);
			totalSum += vectors[i].getSum();
		}

		if(totalSum == 0)
			System.out.println("YES");
		else
			System.out.println("NO");
	}

}
class Vector
{
	private int one;
	private int two;
	private int three;

	public Vector(int one, int two, int three)
	{
		this.one = one;
		this.two = two;
		this.three = three;
	}

	public int getSum()
	{
		return one+two+three;
	}

	public String toString()
	{
		return(one+","+two+","+three);
	}

}


import java.util.*;

public class Main {

	public static void main(String[] args)
	{
		Scanner reader = new Scanner(System.in);
		int n = reader.nextInt();
		Vector []vectors = new Vector[n];
		int oneSum = 0;
		int twoSum = 0;
		int threeSum = 0;
		for(int i=0; i<n; i++)
		{
			int one = reader.nextInt();
			int two = reader.nextInt();
			int three = reader.nextInt();
			vectors[i] = new Vector(one,two,three);
			oneSum += vectors[i].getOne();
			twoSum += vectors[i].getTwo();
			threeSum += vectors[i].getThree();

		}
		if((oneSum == 0) &&(twoSum == 0)&&(threeSum ==0))
			System.out.println("YES");
		else
			System.out.println("NO");
	}

}
class Vector
{
	private int one;
	private int two;
	private int three;

	public int getOne() {
		return one;
	}

	public void setOne(int one) {
		this.one = one;
	}

	public int getTwo() {
		return two;
	}

	public void setTwo(int two) {
		this.two = two;
	}

	public int getThree() {
		return three;
	}

	public void setThree(int three) {
		this.three = three;
	}

	public Vector(int one, int two, int three)
	{
		this.one = one;
		this.two = two;
		this.three = three;
	}

	public int getSum()
	{
		return one+two+three;
	}

	public String toString()
	{
		return(one+","+two+","+three);
	}

}


import java.util.Scanner;

/**
 * Created by Ferrumit on 6/15/2016.
 */
public class _69A {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a=0;
        int b=0;
        int c=0;

        for(int i=0;i<n;i++)
        {
            a+= in.nextInt();
            b+= in.nextInt();
            c+= in.nextInt();
        }

        System.out.print(a==0 && b==0 && c==0?"YES":"NO");
    }
}


import java.util.Scanner;

/**
 * Created by Ferrumit on 6/15/2016.
 */
public class _69A {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a=0;
        int b=0;
        int c=0;

        for(int i=0;i<n;i++)
        {
            a+= in.nextInt();
            b+= in.nextInt();
            c+= in.nextInt();
        }

        System.out.print(a+b+c==0?"YES":"NO");
    }
}


import java.util.*;
public class Main {
    public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int a=sc.nextInt(),c=0;
    for(int i=0;i<a;i++)
        c+=sc.nextInt()+sc.nextInt()+sc.nextInt();
    System.out.println(c==0?"YES":"NO");
    }
}


import java.util.*;
public class Main {
    public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int a=sc.nextInt(),x=0,y=0,z=0;
    for(int i=0;i<a;i++)
    {
        x+=sc.nextInt();
        y+=sc.nextInt();
        z+=sc.nextInt();
    }
    System.out.println(x==0 && y==0 & z==0?"YES":"NO");
    }
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author Lotus
 */
public class A69 {
    public static void main(String[]args)
    {
        Scanner input= new Scanner(System.in);
        int n= input.nextInt();

        int x=0;
        int y=0;
        int z=0;
        for(int i=0 ; i<n ; i++)
        {
           x+=input.nextInt();
           y+=input.nextInt();
           z+=input.nextInt();
        }

        if(x==0 && y==0 && z==0)
        {
            System.out.print("YES");
        }
        else
             System.out.print("NO");
    }

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author Lotus
 */
public class A69 {
    public static void main(String[]args)
    {
        Scanner input= new Scanner(System.in);
        int n= input.nextInt();
        int counter=0;
        int x=0;
        int y=0;
        int z=0;
        for(int i=0 ; i<n ; i++)
        {
           x+=input.nextInt();
           y+=input.nextInt();
           z+=input.nextInt();
        }

        if(counter==0)
        {
            System.out.print("YES");
        }
        else
             System.out.print("NO");
    }

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author Lotus
 */
public class A69 {
    public static void main(String[]args)
    {
        Scanner input= new Scanner(System.in);
        int n= input.nextInt();
        int [][] physics = new int[n][3];
        int counter=0;
        for(int i=0 ; i<n ; i++)
        {
           for(int j=0 ;j<3 ; j++)
           {
               physics[i][j]=input.nextInt();

               counter+=physics[i][j];
           }
        }

        if(counter==0)
        {
            System.out.print("YES");
        }
        else
             System.out.print("NO");
    }

}


import org.omg.DynamicAny._DynArrayStub;

import java.lang.reflect.Array;
import java.util.*;

/**
 * Created by root on 7/14/14.
 */
public  class test {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] sums = new int[n];

        int[] first = new int[n];
        int[] second = new int[n];
        int[] third = new int[n];

        for (int i = 0; i < sums.length; i++) {

            first[i] = sc.nextInt();
            second[i] = sc.nextInt();
            third[i] = sc.nextInt();

        }

        int result_first = 0;
        int result_second = 0;
        int result_third = 0;

        for (int i = 0; i < first.length; i++) {
            result_first += first[i];
        }

        for (int i = 0; i < second.length; i++) {
            result_second += second[i];
        }

        for (int i = 0; i < third.length; i++) {
            result_third += third[i];
        }

        if(result_first == 0 && result_second == 0 && result_third == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

    }

    }


import org.omg.DynamicAny._DynArrayStub;

import java.lang.reflect.Array;
import java.util.*;

/**
 * Created by root on 7/14/14.
 */
public  class test {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] sums = new int[n];

        int[] first = new int[n];
        int[] second = new int[n];
        int[] third = new int[n];

        for (int i = 0; i < sums.length; i++) {

            first[i] = sc.nextInt();
            second[i] = sc.nextInt();
            third[i] = sc.nextInt();

        }

        int result_first = 0;
        int result_second = 0;
        int result_third = 0;

        for (int i = 0; i < first.length; i++) {
            result_first += first[i];
        }

        for (int i = 0; i < second.length; i++) {
            result_second += second[i];
        }

        for (int i = 0; i < third.length; i++) {
            result_third += third[i];
        }

        if(result_first + result_second + result_third == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

    }

    }


import org.omg.DynamicAny._DynArrayStub;

import java.lang.reflect.Array;
import java.util.*;

/**
 * Created by root on 7/14/14.
 */
public  class test {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] sums = new int[n];

        for (int i = 0; i < sums.length; i++) {

            int first = sc.nextInt();
            int second = sc.nextInt();
            int third = sc.nextInt();

            sums[i] = first+second+third;

        }

        int result = 0;

        for (int i = 0; i < sums.length; i++) {
            result += sums[i];
        }

        if (result == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

    }

    }


import java.util.*;
/**
 *
 * @author user
 */
public class YoungPhyscist {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int []a = new int[num];
        int []b = new int[num];
        int []c = new int[num];
        int sum=0;
        for(int i=0; i<num; i++)
        {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
            c[i] = in.nextInt();
            sum+=a[i]+b[i]+c[i];
        }
        if(sum!=0)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
/**
 *
 * @author user
 */
public class YoungPhyscist {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int []a = new int[num];
        int []b = new int[num];
        int []c = new int[num];
        //int []sum = new int[num];
        for(int i=0; i<num; i++)
        {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
            c[i] = in.nextInt();

        }
        int sum1 = a[0] + b[0] + c[0];
        int sum2 = a[1] + b[1] + c[1];
        int sum3 = a[2] + b[2] + c[2];

        int sum = sum1 + sum2 + sum3;

        if(sum!=0)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
public class YoungPhysicist {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int [][]arr = new int[n][3];
        for(int i=0;i<n;i++)
        {
            for(int j=0; j<3;j++)
            {
                arr[i][j] = in.nextInt();
            }
        }

        int x=0,y=0,z=0;
        for(int i=0; i<n;i++)
            //x[i] = arr[n][0];
            x+=arr[i][0];
        for(int i=0; i<n;i++)
            y+=arr[i][1];
        for(int i=0; i<n;i++)
            z+= arr[i][2];
        if(x==0 && y==0 && z==0)    System.out.println("YES");
        else                        System.out.println("NO");
    }
}


import java.util.Scanner;

/**
 * Created by sherif on 31/01/16.
 */
public class Yung {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String res =  "NO";

        int num = in.nextInt();
        Integer[][] arr = new Integer[num][3];

        if (num >= 1 && num <= 100) {
            for (int i = 0; i < num; i++) {
                for (int j = 0; j < 3; j++) {
                    int d = in.nextInt();
                    if (d >= -100 && d <= 100) {
                        arr[i][j] = d;
                    }
                }
            }
        }

        int d = 0;
        for (int j = 0; j < 3; ++j) {
            for (int i = 0; i < num; ++i) {
                d += arr[i][j];
                if (i == num - 1)
                    if (d != 0) {
                        res = "NO";
                        break;
                    } else
                    res = "YES";
            }
        }
        System.out.println(res);
    }
}