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