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