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