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