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