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