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
//package com.company;
import com.sun.nio.sctp.SctpStandardSocketOptions;

import javax.swing.*;
import java.util.Calendar;
import java.net.StandardSocketOptions;
import java.util.*;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.*;
import java.util.ArrayList;
/*
						            	    DOMINGO_GIRL :)
											─────────▄──────────────▄
											────────▌▒█───────────▄▀▒▌
											────────▌▒▒▀▄───────▄▀▒▒▒▐
											───────▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
											─────▄▄▀▒▒▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
											───▄▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀██▀▒▌
											──▐▒▒▒▄▄▄▒▒▒▒▒▒▒▒▒▒▒▒▒▀▄▒▒▌
											──▌▒▒▐▄█▀▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
											─▐▒▒▒▒▒▒▒▒▒▒▒▌██▀▒▒▒▒▒▒▒▒▀▄▌
											─▌▒▀▄██▄▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▌
											─▌▀▐▄█▄█▌▄▒▀▒▒▒▒▒▒░░░░░░▒▒▒▐ Wow
											▐▒▀▐▀▐▀▒▒▄▄▒▄▒▒▒▒▒░░░░░░▒▒▒▒▌
										   	▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒░░░░░░▒▒▒▐
											─▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒▒▒░░░░▒▒▒▒▌
											─▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
											──▀▄▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▄▒▒▒▒▌
											────▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
											───▐▀▒▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
											──▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀▀
                                    	*/

public class Main {
    public static void main(String[] arg) {
        Scanner sc = new Scanner(System.in);
        int t=sc.nextInt();int a[]=new int[t-1];int s=0;
        for(int i=0;i<t-1;i++){
            a[i]=sc.nextInt();s+=a[i];
        }
        int n=sc.nextInt(),m=sc.nextInt();
        int diff=Math.abs(n-m);int sum=0;int d=0;
        for(int i=n-1,j=0;j<diff&&i<a.length;i++,j++){
            sum+=a[i];
        }
        System.out.println(sum);
    }



    static int findLongestConseqSubseq(int arr[], int n)
    {
    /* We insert all the array elements into
    unordered set. */
        HashSet<Integer> S = new HashSet<Integer>();
        for (int i = 0; i < n; i++)
            S.add(arr[i]);

        // check each possible sequence from the start
        // then update optimal length
        int ans = 0;
        for (int i = 0; i < n; i++)
        {

            // if current element is the starting
            // element of a sequence
            if(S.contains(arr[i]))
            {

                // Then check for next elements in the
                // sequence
                int j = arr[i];

                // increment the value of array element
                // and repeat search in the set
                while (S.contains(j))
                    j++;

                // Update optimal length if this length
                // is more. To get the length as it is
                // incremented one by one
                ans = Math.max(ans, j - arr[i]);
            }
        }
        return ans;
    }

    static int nextPowerOf2(int n)
    {
        int count = 0;

        // First n in the below
        // condition is for the
        // case where n is 0
        if (n > 0 && (n & (n - 1)) == 0)
            return n;

        while(n != 0)
        {
            n >>= 1;
            count += 1;
        }

        return 1 << count;
    }


    public static int ArrivalOfTheGeneral(int n,int a[]){
          int max=Integer.MIN_VALUE;int maxIndex=0;
          for(int i=0;i<a.length;i++){
              if(a[i]>max){
                  max=a[i];maxIndex=i;
              }
          }
          //System.out.println(max+" "+maxIndex);
          int c1=0;
          for(int i=maxIndex;i>0;i--){
              int temp=a[maxIndex];
              a[maxIndex]=a[i-1];
              a[i-1]=temp;
              c1++;maxIndex--;
          }
          //System.out.println(Arrays.toString(a));
          int min=Integer.MAX_VALUE;int minIndex=0;
          for(int i=0;i<a.length;i++){
              if(a[i]<=min){
                  min=a[i];minIndex=i;
              }
          }
          int c2=0;
          for(int i=minIndex;i<a.length-1;i++){
              int temp=a[minIndex];
              a[minIndex]=a[i+1];
              a[i+1]=temp;
              c2++;minIndex++;
          }
          return c1+c2;
      }
      public static String IWannaBetheGuy(int n,int x,int ax[],int y,int ay[]){

          ArrayList<Integer>ar=new ArrayList<>();
          for(int i=1;i<=n;i++)ar.add(i);
          for(int i=0;i<ax.length;i++){
              if(ar.contains(ax[i]))ar.remove(ar.indexOf(ax[i]));
          }
          for(int i=0;i<ay.length;i++){
              if(ar.contains(ay[i]))ar.remove(ar.indexOf(ay[i]));
          }
          if(ar.size()==0)return "I become the guy.";
          else  return "Oh, my keyboard!";

      }

      public static String UltraFastMathematician(String s1,String s2){

          String res="";
          for(int i=0;i<s1.length();i++){
              if((s1.charAt(i)=='1'&&s2.charAt(i)=='1')||(
                  s1.charAt(i)=='0'&&s2.charAt(i)=='0'))
                   res+='0';
              else res+='1';
          }
          return res;
      }

      public static int InsomniaCure(int k,int l,int m,int n,int d){
           int dameged=0;
          for(int i=1;i<=d;i++){
              if(i%k==0||i%l==0||i%n==0||i%m==0)dameged++;
          }
          return dameged;
      }

    // function to find the maximum
    // number of segments
    static int maximumSegments(int n, int a,
                               int b, int c)
    {
        // stores the maximum number of
        // segments each index can have
        int dp[] = new int[n + 10];

        // initialize with -1
        Arrays.fill(dp, -1);

        // 0th index will have 0 segments
        // base case
        dp[0] = 0;

        // traverse for all possible
        // segments till n
        for (int i = 0; i < n; i++)
        {
            if (dp[i] != -1)
            {

                // conditions
                if(i + a <= n )    //avoid buffer overflow
                    dp[i + a] = Math.max(dp[i] + 1,
                            dp[i + a]);

                if(i + b <= n )    //avoid buffer overflow
                    dp[i + b] = Math.max(dp[i] + 1,
                            dp[i + b]);

                if(i + c <= n )    //avoid buffer overflow
                    dp[i + c] = Math.max(dp[i] + 1,
                            dp[i + c]);
            }
        }
        return dp[n];
    }





    // Recursive function to return gcd of a and b
    static int gcd(int a, int b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    // method to return LCM of two numbers
    static int lcm(int a, int b)
    {
        return (a*b)/gcd(a, b);
    }

    // Function to return LCM of two numbers without GCD method
    public static int findLCM(int a, int b)
    {
        int lar = Math.max(a, b);
        int small = Math.min(a, b);
        for (int i = lar; ; i += lar) {
            if (i % small == 0)
                return i;
        }
    }

    //Function to find gcd of array of numbers
    static int findGCD(int arr[], int n)
    {
        int result = arr[0];
        for (int i = 1; i < n; i++)
            result = gcd(arr[i], result);

        return result;
    }


    // method to print the divisors
    static void printDivisors(int n)
    {
        TreeSet<Integer>t=new TreeSet<>();
        // Note that this loop runs till square root
        for (int i=1; i<=Math.sqrt(n); i++)
        {
            if (n%i==0)
            {
                // If divisors are equal, print only one
                if (n/i == i)
                    t.add(i);

                else // Otherwise print both
                    t.add(i);t.add(n/i);
            }
        }
        //Collections.sort(h);
        Iterator<Integer> ir = t.iterator();
        while(ir.hasNext())System.out.println(ir.next());
    }

    // A function to print all prime factors
    // of a given number n
    public static void primeFactors(int n)
    {
        // Print the number of 2s that divide n
        while (n%2==0)
        {
            System.out.print(2 + " ");
            n /= 2;
        }

        // n must be odd at this point.  So we can
        // skip one element (Note i = i +2) because
        //difference of two prime factors must be at least 2
        //Every composite number has at least one prime factor less than or equal to square root of itself.
        for (int i = 3; i <= Math.sqrt(n); i+= 2)
        {
            // While i divides n, print i and divide n
            while (n%i == 0)
            {
                System.out.print(i + " ");
                n /= i;
            }
        }

        // This condition is to handle the case whien
        // n is a prime number greater than 2
        if (n > 2)
            System.out.print(n);
    }



    static int findIndex(int[] a, int item)
    {
        for(int i = 0; i < a.length; ++i)
            if(item == a[i])
                return i;
        return -1;
    }
    static boolean isPal(char[] s) {
        for (int i = 0; i < s.length / 2; i++)
            if (s[i] != s[s.length - i - 1])
                return false;
        return true;
    }
    static String get(int sec) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.set(Calendar.SECOND, sec);
        return new SimpleDateFormat("HH:mm:ss").format(calendar.getTime());

    }
    static class Pair  {
        int idx;
        int first, second;

        Pair(int a, int b, int c) {
            first = a;
            second = b;
            idx = c;
        }

    }

    //System.out.println(s);
    //pw.println(s);

/*
    static void moveT(int []a,int idx){
        int t=a[idx];
        for(int i=idx;i>0;i--){
            a[i]=a[i-1];
        }
        a[0]=t;
    }
    static int findIndex(int[] a, int item)
    {
        for(int i = 0; i < a.length; ++i)
            if(item == a[i])
                return i;
        return -1;
    }
    static class pair implements Comparable<pair>{
        int idx;
        int value;

        pair(int idx,int value){
            this.idx=idx;
            this.value=value;
        }

        @Override
        public int compareTo(pair o) {
            return o.value-this.value;
        }
    }

*/


    //Equilibrium index of an array is an index such that the sum of elements
    // at lower indexes is equal to the sum of elements at higher indexes.

    int equilibrium(int arr[], int n)
    {
        int sum = 0; // initialize sum of whole array
        int leftsum = 0; // initialize leftsum

        /* Find sum of the whole array */
        for (int i = 0; i < n; ++i)
            sum += arr[i];

        for (int i = 0; i < n; ++i) {
            sum -= arr[i]; // sum is now right sum for index i

            if (leftsum == sum)
                return i;

            leftsum += arr[i];
        }

        /* If no equilibrium index found, then return 0 */
        return -1;
    }








}