#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9;
const long long N = 1e6 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
using namespace std;
bool used[1000001];
void solve() {
  int n, a[101];
  cin >> n;
  for (int i = 0; i < n - 1; ++i) cin >> a[i];
  int d, c, ct = 0;
  cin >> d >> c;
  for (int i = d - 1; i < c - 1; ++i) ct += a[i];
  cout << ct << endl;
}
bool mtest = false;
int main() {
  ios_base::sync_with_stdio(0);
  int TE = 1;
  if (mtest) cin >> TE;
  while (TE--) solve();
  return 0;
}
