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