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