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