#include <bits/stdc++.h>
using namespace std;
int sum(int n,vector<int> nums){
if(n==0)return nums[0];
return nums[n]+sum(n-1,nums);
}
int main() {
// your code goes here
int n;
cin>>n;
vector<int> nums(n);
for(int i=0;i<n;i++){
int e;
cin>>e;
nums[i]=e;
}
cout<<sum(n-1, nums);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgc3VtKGludCBuLHZlY3RvcjxpbnQ+IG51bXMpewoJaWYobj09MClyZXR1cm4gbnVtc1swXTsKCXJldHVybiBudW1zW25dK3N1bShuLTEsbnVtcyk7Cn0KCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJaW50IG47CgljaW4+Pm47Cgl2ZWN0b3I8aW50PiBudW1zKG4pOwoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJaW50IGU7CgkJY2luPj5lOwoJCW51bXNbaV09ZTsKCX0KCWNvdXQ8PHN1bShuLTEsIG51bXMpOwoJCglyZXR1cm4gMDsKfQ==