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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

import java.util.Stack;

 
public class george
{
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;
 
        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }
 
        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');
 
            if (neg)
                return -ret;
            return ret;
        }
 
        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }
 
        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
 
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
 
            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }
 
            if (neg)
                return -ret;
            return ret;
        }
 
        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
 
        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }
 
        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
    static int min(int []arr,int n) {
    int min=arr[0],k=-1;
    for(int i=0;i<n;i++) {
    	if(min>arr[i]) {
    		k=arr[i];
    	}
    }
    return k;
    }
    static int max(int []arr,int n) {
        int max=arr[0],k=-1;
        for(int i=1;i<n;i++) {
        	if(arr[i]>max) 
        		k=arr[i];
        }
        return k;
        }
static long gcd(long a,long b) {
	if (b==0) return a;
	return gcd(b,a%b);
}
static long lcm(int a,int b) {

	return a*b/gcd(a,b);
}
static int tprime(int n) {
int a=1;
	for(int i=2;i<=n;i++) {
		if(n%i==0) {
			System.out.println(i);
			a++;
		}
	}
	return a;
}
static long fact(int n){    
	long fact1=1;  
	      
	  for(int i=1;i<=n;i++){    
	      fact1=fact1*i;    
	  }   
	  return fact1;
	 }    
static void calculateSpan(int price[], int n, int S[])
{
    
    Stack<Integer> st= new Stack<>();
    st.push(0); 
    
    S[0] = 1;
    for (int i = 1; i < n; i++)
    {
        while (!st.empty() && price[st.peek()] <= price[i])
            st.pop();
        S[i] = (st.empty())? (i + 1) : (i - st.peek());
 
       
        st.push(i);
    }
}
 
static void printArray(int arr[],int n)
{
	for(int i=0;i<n;i++) {
    System.out.print(arr[i]+" ");
    }
	System.out.println();
}
 
    public static void main(String[] args) throws IOException
    {
    	int arr[]=new int[200];
        Reader s=new Reader();
       int n=s.nextInt();
 for(int i=0;i<n-1;i++) {
	 arr[i]=s.nextInt();
 }
 int a=s.nextInt();
 int b=s.nextInt();
 int res=0;
 for(int i=a-1;i<b-1;i++) {
	 res+=arr[i];
 }
 System.out.println(res);
}
}