#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, a[1111], second, t;
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  cin >> second >> t;
  cout << a[t] - a[second];
  return 0;
}
