#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1;
const int MAXM = 1;
const int MAXK = 1;
int N, M, K, A[1001], ans;
int main() {
  scanf("%d", &N);
  for (int i = 0, _n = (N - 1); i < _n; i++) {
    scanf("%d", &A[i]);
  }
  scanf("%d%d", &M, &K);
  for (int i = (M - 1), _b = (K - 2); i <= _b; i++) ans += A[i];
  printf("%d\n", ans);
  return 0;
}
