#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> ara(n - 1);
  int counter = 0;
  int a, b;
  for (int i = 0; i < n - 1; ++i) {
    cin >> ara[i];
  }
  cin >> a >> b;
  for (int i = a; i < b; ++i) {
    counter += ara[i - 1];
  }
  cout << counter << "\n";
  return 0;
}
