#include <bits/stdc++.h>
using namespace std;
void route(int t) {
  int a[t], sum = 0;
  for (int i = 0; i < t - 1; i++) cin >> a[i];
  int x, y;
  cin >> x >> y;
  for (int i = x - 1; i < y - 1; i++) sum += a[i];
  cout << sum << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  route(t);
  return 0;
}
