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