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