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