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