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