#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5;
int a[mx+5];
int main() {
int n, x, y, ans = 0;
cin >> n;
for (int i = 1; i < n; i++) cin >> a[i];
cin >> x >> y;
for (int i = x; i < y; i++) ans += a[i];
cout << ans << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbXggPSAxZTU7CmludCBhW214KzVdOwoKaW50IG1haW4oKSB7CglpbnQgbiwgeCwgeSwgYW5zID0gMDsKCWNpbiA+PiBuOwoJZm9yIChpbnQgaSA9IDE7IGkgPCBuOyBpKyspIGNpbiA+PiBhW2ldOwoJY2luID4+IHggPj4geTsKCWZvciAoaW50IGkgPSB4OyBpIDwgeTsgaSsrKSBhbnMgKz0gYVtpXTsKCWNvdXQgPDwgYW5zIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQo=