#include <iostream>
using namespace std;
int v[1001];
int main()
{
int n,i,i1,i2;
cin>>n;
i1=i2=0;bool ok=1;
for(i=1;i<=n;++i)
{
cin>>v[i];
if(ok==0&&v[i]%2==1)
i1=i,ok=1;
}
ok=0;
for(i=n;i>=1;--i)
if(ok==0&&v[i]%2==1)
i2=i,ok=1;
int s=0;
for(i=i1;i<=i2;++i)
s+=v[i];
cout<<s;
return 0;
}