#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, d;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> d;
    v.push_back(d);
  }
  int a, b, count;
  cin >> a >> b;
  count = 0;
  for (int i = a - 1; i < b - 1; i++) {
    count += v[i];
  }
  cout << count;
}
