#include <iostream>
using namespace std;
int main() {
int tab[10000];
int n, a, b, s=0;
cin >> n;
for(int i=0;i<n;i++) {
cin >> tab[i];
}
cin >> a >> b;
for(int i=a-1;i<=b-1;i++) {
s += tab[i];
}
cout << s;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB0YWJbMTAwMDBdOwoJaW50IG4sIGEsIGIsIHM9MDsKCWNpbiA+PiBuOwoJZm9yKGludCBpPTA7aTxuO2krKykgewoJCWNpbiA+PiB0YWJbaV07Cgl9CgljaW4gPj4gYSA+PiBiOwoJZm9yKGludCBpPWEtMTtpPD1iLTE7aSsrKSB7CgkJcyArPSB0YWJbaV07IAoJfQoJY291dCA8PCBzOwoKCXJldHVybiAwOwp9