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