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