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