#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[10000];
  while (cin >> n) {
    for (int i = 1; i < n; i++) {
      cin >> arr[i];
    }
    int c, d, sum = 0;
    cin >> c >> d;
    for (int i = c; i < d; i++) {
      sum += arr[i];
    }
    cout << sum << endl;
  }
}
