#include<iostream>
#include<bits/stdc++.h>
using namespace std;
const int N=110;
int d[N];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n-1;i++)cin>>d[i];
int a,b;
cin>>a>>b;
int res=0;//答案
for(int i=a;i<b;i++)res+=d[i];
cout<<res;
}