#include <bits/stdc++.h>
using namespace std;
int ar1[1000][1000], ar2[10000000];
int re1 = 0, re2 = 0;
int test = 0;
int main() {
  int a = 0, b = 0, c = 0, d = 0, result1 = 0, result2;
  scanf("%d", &a);
  for (int i = 2; i <= a; i++) {
    scanf("%d", &ar2[i]);
  }
  scanf("%d %d", &b, &c);
  while (b < c) {
    result1 += ar2[b + 1];
    b++;
  }
  printf("%d", result1);
}
