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