//============================================================================
// Name        : [email protected]	A. Army
// Author      : LiJunLe
// Version     : Accepted
// Copyright   : http://www.codeforces.com/contest/38/problem/A
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <stdio.h>
#define M 105
using namespace std;
int data[M];

int main() {
	int n;
	while (scanf("%d", &n) != EOF) {
		for (int i = 0; i < n-1; i++) {
			scanf("%d", &data[i]);
		}
		int a, b;
		scanf("%d%d", &a, &b);
		int ret = 0;
		for (int i = a-1; i < b-1; i ++) {
			ret += data[i];
		}
		printf("%d\n", ret);
	}
	return 0;
}