#include <iostream>
using namespace std;
int main()
{
int n,sum=0;
cin >> n;
int a[4];
for (int i = 0;i <=n/2-1;i++) {
cin >> a[0] >> a[1];
sum = sum + a[0];
}
for (int i = n / 2;i < n;i++) {
cin >> a[0] >> a[1];
sum = sum + a[1];
}
cout << sum;
}