The Berland Armed Forces System consists of n ranks that are numbered using natural numbers from 1 to n, where 1 is the lowest rank and n is the highest rank.

One needs exactly di years to rise from rank i to rank i + 1. Reaching a certain rank i having not reached all the previous i - 1 ranks is impossible.

Vasya has just reached a new rank of a, but he dreams of holding the rank of b. Find for how many more years Vasya should serve in the army until he can finally realize his dream.

Input

The first input line contains an integer n (2 ≤ n ≤ 100). The second line contains n - 1 integers di (1 ≤ di ≤ 100). The third input line contains two integers a and b (1 ≤ a < b ≤ n). The numbers on the lines are space-separated.

Output

Print the single number which is the number of years that Vasya needs to rise from rank a to rank b.

Examples

Input

3
5 6
1 2


Output

5


Input

3
5 6
1 3


Output

11

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
public class Q1 {
	static int[]d;
	static int[][]memo;
	public static void main(String[] args) throws Exception {
		Scanner sc= new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n=sc.nextInt();
		d= new int [n-1];
		memo = new int [n+1][n+1];
		for (int i=0;i-1<n;i++) {
			Arrays.fill(memo[i], -1);
		}
		for(int i=0;i<d.length;i++) {
			d[i]=sc.nextInt();
		}
		out.println(solve(sc.nextInt(),sc.nextInt()));
			out.flush();
		
	}
	public static int solve(int a,int b)
	{
		if(memo[a][b]!=-1)
			return memo[a][b];
		
		
		if (a==b)
			return 0;
		
		else memo[a][b]= d[a-1]+solve(a+1,b);
		return memo[a][b];
		
		
	}
	
	
	public static int gcd(int a,int b) {
		return a%b==0?b:gcd(b,a%b);
	}
	
	public static List<List<String>> groupAnagrams(String[] strs) {
		List Solution  = new ArrayList<ArrayList<String>>();
		pair Sorted [] = new pair[strs.length];

		for(int i=0;i<strs.length;i++) {
			char[] chars = strs[i].toCharArray();
			Arrays.sort(chars);
			String sorted = new String(chars);
			Sorted[i]=new pair(strs[i],sorted);

		}
		Arrays.sort(Sorted);
		System.out.println(Arrays.toString(Sorted));
		all:	for(int i=0;i<strs.length;i++) {
			ArrayList<String> sol = new ArrayList<>();
			sol.add(Sorted[i].org);
			if(strs.length==1||i==strs.length-1) {
				Solution.add(sol);
				break;
			}

			for(int j=i+1;j<strs.length;j++) {
				if (Sorted[i].sorted.equals(Sorted[j].sorted)) {
					sol.add(Sorted[j].org);
					if(j==strs.length-1) {
						Solution.add(sol);
						break all;
					}
				}
				else {
					i=j-1;
					Solution.add(sol);
					break;
				}
			}
		}
		System.out.println(Solution);
		return Solution;

	}
	public static void rotate(int[][] matrix) {
		int [][] res= new int [matrix.length][matrix.length];
		for (int i=0;i<res.length;i++) {
			for(int j=0;j<res.length;j++) {
				res[j][matrix.length-1-i]=matrix[i][j];
			}
		}

		for (int i=0;i<res.length;i++) {
			for(int j=0;j<res.length;j++) {
				matrix[i][j]=res[i][j];
			}
		}
	}
	public static int lengthOfLongestSubstring(String s) {
		int sol=0;
		HashSet <Character> seenSoFar= new HashSet<Character>();
		int maxsofar=0;
		int lastVisited = 0;

		for(int i=0;i<s.length();i++) {
			System.out.println("I am now visiting :"+s.charAt(i));
			if (!seenSoFar.contains(s.charAt(i))) {
				System.out.println("i was not found in the hashset");
				maxsofar++;
				sol=Math.max(sol,maxsofar);
				seenSoFar.add(s.charAt(i));
			}
			else {
				System.out.println("I was found in the hashset");
				sol=Math.max(maxsofar, sol);
				seenSoFar=new HashSet<>();
				maxsofar=0;
				i=lastVisited;
				lastVisited++;

			}
		}
		return sol;
	}

	public static int[] findOrder(int numCourses, int[][] prerequisites) {
		int [] sol=new int [numCourses];
		ArrayList<Integer>adjList[] = new ArrayList[numCourses];
		for (int i = 0; i < adjList.length; i++) {
			adjList[i]=new ArrayList<>();
		}
		HashSet<Integer> notroot = new HashSet<>();
		for(int []p:prerequisites) {
			adjList[p[1]].add(p[0]);
			notroot.add(p[0]);
		}
		ArrayList<Integer> root= new ArrayList<>();
		for (int i=0;i<numCourses;i++) {
			if (!notroot.contains(i)) {
				root.add(i);
			}
		}
		boolean v[]=new boolean[numCourses];
		bfs(root,v,adjList,sol);
		System.out.println(Arrays.toString(sol));
		
		return sol;
	}

	static void bfs(ArrayList<Integer> s,boolean visited [], ArrayList<Integer>adjList[],int ans[])
	{
		int i=0;
		Queue<Integer> q = new LinkedList<Integer>();
		for(int c:s) {
			q.add(c);
			ans[i++]=c;
			visited[c] = true;
			System.out.println(Arrays.toString(ans));
		}
		while(!q.isEmpty())
		{
			int u = q.remove();

			for(int v: adjList[u])
				if(!visited[v])
				{
					System.out.println(Arrays.toString(ans));
					visited[v] = true;
					ans[i++]=v;
					q.add(v);
				}
		}
	}
}

class pair implements Comparable<pair>{
	String org;
	String sorted;
	pair(String n,String p){
		org=n;
		sorted=p;}
	@Override
	public int compareTo(pair o) {
		return sorted.compareTo(o.sorted);
	}
	@Override
	public String toString() {
		return org+":"+sorted;
	}


}
class Scanner{
	StringTokenizer st;
	BufferedReader br;
	public Scanner(InputStream system) { br = new BufferedReader(new InputStreamReader(system));}
	public Scanner(String file) throws Exception{br = new BufferedReader(new FileReader (file));}
	public String next() throws IOException{
		while (st==null|| !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	public int nextInt() throws IOException{
		return Integer.parseInt(next());
	}
	public long nextLong() throws IOException{
		return Long.parseLong(next());
	}
	public String nextLine() throws IOException{
		return br.readLine();
	}

}

