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