#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, a, b;
  cin >> n;
  int arr[1001];
  for (int i = 1; i <= n - 1; i++) {
    cin >> arr[i];
  }
  cin >> a >> b;
  int cnt = 0;
  int c = b - a;
  while (c--) {
    cnt += arr[a];
    a++;
  }
  cout << cnt << endl;
  return 0;
}
