#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 7;
const int maxn = (int)6e5 + 7;
const long long dx[] = {-1, 0, 0, 1};
const long long dy[] = {0, -1, 1, 0};
string s;
vector<long long> v;
long long n, a[211111], res;
int main() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    cin >> a[i];
  }
  long long q, k;
  cin >> q >> k;
  for (long long i = q; i <= k - 1; i++) {
    res += a[i];
  }
  cout << res;
}
