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