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