#include <bits/stdc++.h>
int i, j, n, m, b, z, d, k, a1, s, b1, l, z1, x, a[101];
void sol() {
  for (i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
  }
  s = 0;
  scanf("%d%d", &z, &b);
  for (i = z - 1; i < b - 1; i++) {
    s += a[i];
  }
  printf("%d\n", s);
  return;
}
int main() {
#pragma comment(linker, "/STACK:16777216")
  while (scanf("%d", &n) != EOF) {
    sol();
  }
  return 0;
}
