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