#include <bits/stdc++.h>
using namespace std;
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;
}
for(int i=1;i<n;i++){
nums[i]=nums[i-1]+nums[i];
}
int i,j;
cin>>i>>j;
cout<<nums[j]-nums[i-1];
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBuOwoJY2luPj5uOwoJdmVjdG9yPGludD4gbnVtcyhuKTsKCWZvcihpbnQgaT0wO2k8bjtpKyspewoJCWludCBlOwoJCWNpbj4+ZTsKCQludW1zW2ldPWU7Cgl9Cglmb3IoaW50IGk9MTtpPG47aSsrKXsKCQludW1zW2ldPW51bXNbaS0xXStudW1zW2ldOwoJfQoJaW50IGksajsKCWNpbj4+aT4+ajsKCWNvdXQ8PG51bXNbal0tbnVtc1tpLTFdOwp9