#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, n, a[120], x, y, i;
  cin >> n;
  for (i = 0; i < n - 1; ++i) {
    cin >> a[i];
  }
  cin >> x >> y;
  for (i = x - 1; i < y - 1; ++i) {
    sum += a[i];
  }
  cout << sum << "\n";
}
