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