#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
int sum = 0;
int count=0;
vector<int> b(50);
for (int i = 0; i < n; i++)
{
cin >> b[i];
count++;
}
for (int i = count; i>=0; i--)
{
sum += b[i];
}
cout << sum << endl;
return 0;
}
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
int sum = 0;
int count=0;
vector<int> b(50);
for (int i = 0; i < n; i++)
{
cin >> b[i];
count++;
}
for (int i = count; i>=0; i--)
{
sum += b[i];
}
cout << sum << endl;
return 0;
}