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