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