#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d[200], a, b, year = 0, c;
  cin >> n;
  for (int i = 2; i <= n; i++) cin >> d[i];
  cin >> a >> b;
  for (int i = 1 + a; i <= b; i++) {
    year += d[i];
  }
  cout << year << endl;
  return 0;
}
