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