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