#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, diff = 0, Count = 0;
  int d[100];
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> d[i];
  }
  cin >> a >> b;
  for (int i = 1; i < n; i++) {
    if (a == i) {
      for (int j = i; j < b; j++) {
        Count += d[j - 1];
      }
    }
  }
  cout << Count << endl;
  return 0;
}
