#include <bits/stdc++.h>
int main() {
  int n, i, a, b, years = 0;
  scanf("%d", &n);
  int *array = (int *)malloc(sizeof(int) * (n - 1));
  for (i = 0; i < n - 1; i++) {
    scanf("%d", &array[i]);
  }
  scanf("%d %d", &a, &b);
  for (i = a - 1; i < b - 1; i++) {
    years += array[i];
  }
  printf("%d\n", years);
  return 0;
}
