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