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