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