#include <bits/stdc++.h>
using namespace std;
int need[105];
int main() {
  int n;
  cin >> n;
  int i;
  for (i = 1; i <= n - 1; i++) {
    cin >> need[i];
  }
  int a, b;
  cin >> a >> b;
  int ans = 0;
  for (i = a; i <= b - 1; i++) {
    ans += need[i];
  }
  cout << ans << endl;
  return 0;
}
