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