#include <bits/stdc++.h>
using namespace std;
int main() {
  int d = 0;
  int values[101];
  int a = 0, b = 0;
  int result = 0;
  cin >> d;
  for (int i = 1; i < d; i++) cin >> values[i];
  cin >> a >> b;
  for (int j = a; j < b; j++) result += values[j];
  cout << result;
}
