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