#include <bits/stdc++.h>
using namespace std;
int n, x, y, ans, a[110];
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
  }
  cin >> x >> y;
  for (int i = x + 1; i <= y; i++) {
    ans += a[i];
  }
  cout << ans << endl;
}
