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