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