#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int dp[n];
  dp[0] = 0;
  int a[n - 1];
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i < n; i++) {
    dp[i] = dp[i - 1] + a[i - 1];
  }
  int x, y;
  scanf("%d%d", &x, &y);
  printf("%d\n", dp[y - 1] - dp[x - 1]);
}
