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