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