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