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