import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    private static Scanner scanner = new Scanner(System.in);
    private static int OO = (int) 1e5 + 9;
    private static int[] dx = {0, 0, 1, -1};
    private static int[] dy = {1, -1, 0, 0};

    public static void main(String[] args) {
        int n = scanner.nextInt(), ones = 0;
        int[] arr = new int[n];
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
            if (arr[i] == 1) {
                ones += 1;
                list.add(i);
            }
        }
        if (ones == 0) {
            System.out.println(0);
        } else if (ones == 1) {
            System.out.println(1);
        } else {
            long r = 1;
            for (int i = 0; i < list.size() - 1; i++) {
                r *= list.get(i + 1) - list.get(i);
            }
            System.out.println(r);
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*
8 6

46
 */
public class b
{
	public static void main(String[] arg) throws Exception
	{
		new b();
	}

	public b() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String s = in.next();
		String ans = null;
		int best = 0;
		for(int i = 0; i < s.length(); i++)
		{
			for(int j = i; j < s.length(); j++)
			{
				String sub = s.substring(i, j+1);
				if(valid(sub))
				{
					int cnt = 0;
					for(int k = 0; k < s.length(); k++)
					{
						if(k+sub.length() <= s.length())
						{
							String comp = s.substring(k, k+sub.length());
							if(sub.equals(comp)) cnt++;
						}
					}
					if(cnt > best)
					{
						best = cnt;
						ans = sub;
					}
					else if(cnt == best)
					{
						if(sub.compareTo(ans) < 0)
						{
							ans = sub;
						}
					}
				}
			}
		}
		System.out.println(best==0?"-1":ans);
		in.close(); out.close();
	}
	boolean valid(String s)
	{
		for(int i = 0; i < s.length(); i++)
		{
			if(!(s.charAt(i) == '4' || s.charAt(i) == '7')) return false;
		}
		return true;
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Stack;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] values = line.split(" ");
        int cnt1 = Integer.parseInt(values[0]);
        int cnt2 = Integer.parseInt(values[1]);
        int x = Integer.parseInt(values[2]);
        int y = Integer.parseInt(values[3]);
        long l = 1; long r = Long.MAX_VALUE;
        while (r>l) {
            long mid = (r+l) >> 1;
            long f1 = mid/x; long f2 = mid/y; long both = mid/(x*y);
            if (mid-(f1+f2)+both >= Math.max(cnt1-f2+both, 0) + Math.max(cnt2-f1 + both, 0)) r = mid;
            else l = mid+1;
        }
        System.out.println(l);
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static int n, f[];
    static String s;
    static long ans, dp[][][];

    private static void build() {
        // build failure function F[i] = index of largest prefix/suffix with end < i = where to look if i doesn't match
        f[0] = -1;
        f[1] = 0;
        for(int i = 2; i <= s.length(); i++) {
            f[i] = f[i-1];
            while(f[i] != -1 && s.charAt(i-1) != s.charAt(f[i])) f[i] = f[f[i]];
            ++f[i]; // ++ because this is on the scale of i-2 and not i-1
        }
    }

    private static int getNext(int state, char val) {
        if(state == s.length()) return getNext(f[state], val);
        int nxt = state;
        while(nxt != -1 && s.charAt(nxt) != val) nxt = f[nxt];
        return nxt + 1;
    }

    private static long calc(int n, int curr, int start, int done) {
        if(curr == s.length()) done = 1;
        if(n == 0) return (curr == start && done == 1 ? 1 : 0);

        if(dp[n][curr][done] != -1) return dp[n][curr][done];
        dp[n][curr][done] = 0;
        int nxt0 = getNext(curr, '0');
        int nxt1 = getNext(curr, '1');
        dp[n][curr][done] += calc(n-1, nxt0, start, done);
        dp[n][curr][done] += calc(n-1, nxt1, start, done);
        return dp[n][curr][done];
    }

    private static long solve(int starting_state) {
        dp = new long[n + 1][s.length() + 1][2];
        for(long[][] r1: dp) {
            for (long[] r2 : r1)
                Arrays.fill(r2, -1);
        }
        return calc(n, starting_state, starting_state, 0);
    }

    public static void main(String[] args) {
        InputReader cin = new InputReader(System.in);
        n = cin.nextInt();
        s = cin.next();
        f = new int[s.length() + 1];
        ans = 0;

        build();
        for(int starting_state = 0; starting_state <= s.length(); starting_state++) {
            ans += solve(starting_state);
        }

        System.out.println(ans);
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class D {

    private void solution() throws IOException {
        int n = in.nextInt();
        int a = in.nextInt() - 1, b = in.nextInt() - 1;
        int[] g = new int[n - 1];
        for (int i = 0; i < n - 1; i++) {
            g[i] = in.nextInt();
        }
        int[] k = new int[n];
        for (int i = 0; i < n; i++) {
            k[i] = in.nextInt();
        }

        Map<Integer, Integer> mapL = new HashMap<>();
        Map<Integer, Integer> mapR = new HashMap<>();
        mapL.put(k[a], a);
        mapR.put(k[a], a);

        long[] s = new long[n];

        int l = a, r = a;
        int maxL = a, maxR = a;

        boolean move = true;
        while (move) {
            if (l == b) {
                out.println(s[l]);
                return;
            }
            if (r == b) {
                out.println(s[r]);
                return;
            }
            move = false;
            if (l - 1 >= 0) {
                if (mapL.containsKey(g[l - 1])) {
                    l--;
                    move = true;
                    s[l] = s[l + 1] + 1;
                    if (!mapL.containsKey(k[l])) {
                        mapL.put(k[l], l);
                    }
                } else if (mapR.containsKey(g[l - 1])) {
                    l--;
                    move = true;
                    int p = mapR.get(g[l]);
                    if (p > maxR) {
                        maxR = p;
                    }
                    s[l] = s[maxR] + Math.abs(maxR - l);
                    if (!mapL.containsKey(k[l])) {
                        mapL.put(k[l], l);
                    }
                }
            }
            if (r + 1 < n) {
                if (mapR.containsKey(g[r])) {
                    r++;
                    move = true;
                    s[r] = s[r - 1] + 1;
                    if (!mapR.containsKey(k[r])) {
                        mapR.put(k[r], r);
                    }
                } else if (mapL.containsKey(g[r])) {
                    r++;
                    move = true;
                    int p = mapL.get(g[r - 1]);
                    if (p < maxL) {
                        maxL = p;
                    }
                    s[r] = s[maxL] + Math.abs(maxL - r);
                    if (!mapR.containsKey(k[r])) {
                        mapR.put(k[r], r);
                    }
                }
            }
        }
        out.println(-1);
    }

    private void run() throws IOException {
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);
        solution();
        in.close();
        out.close();
    }

    private Scanner in;
    private PrintWriter out;

    public static void main(String[] args) throws IOException {
        new D().run();
    }

    private class Scanner {

        BufferedReader br;
        StringTokenizer st;

        private Scanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        private String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        private Integer nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        private Long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        private Double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        private void close() throws IOException {
            st = null;
            br.close();
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int n=scanner.nextInt();
        int m=scanner.nextInt();
        m--;
        int max=scanner.nextInt();
        int a[]=new int[n];
        for (int i=0;i<n;i++){
            a[i]=scanner.nextInt();
        }
        int minR=-1;
        int minL=-1;
        for (int i=m;i<n;i++){
            if (a[i]!=0 && a[i]<=max){
                minR=i;
                break;
            }
        }
        for (int i=m;i>=0;i--){
            if (a[i]!=0 && a[i]<=max){
                minL=i;
                break;
            }
        }
        if (minR ==-1){
            System.out.println(Math.abs(minL-m)*10);
        }else if (minL ==-1){
            System.out.println(Math.abs(minR-m)*10);
        }else {
            System.out.println(Math.min(Math.abs(minR-m),Math.abs(minL-m))*10);
        }

    }
}


import java.util.Scanner;

public class C {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);

		int a=in.nextInt();
		int b=in.nextInt();
		int l=in.nextInt();
		int r=in.nextInt();

		System.out.println(fun(a,b,l,r));

	}

	static int fun(int a,int b,int l,int r){
		if ((r-l+1)>2*(a+b))
			if (a<=b)
				return a+1;
			else
				return (2*a-b);

		int[] flag = new int[3*(a+b)+1];

		int temp=0;
		for (int i=1;i<=a;i++){
			flag[i]=i;
			temp=i;
		}

		for (int i=a+1;i<=a+b;i++){
			flag[i]=temp;
		}

		for (int i=a+b+1;i<=a+b+a;i++){
			int tc=1;
			while (in(flag,tc,a+b-a+1,i-1))
				tc++;
			flag[i]=tc;
			temp=flag[i];
		}
		for (int i=a+b+a+1;i<=a+b+a+b;i++){
			flag[i]=temp;
		}
		for (int i=2*(a+b)+1;i<=3*(a+b);i++){
			flag[i]=flag[i-(a+b)];
		}

		int[] flagc = new int[25];
		int templ = l % (a+b);
		if (templ==0) templ+=a+b;
		int tempr = r - l + templ;
		if (tempr<templ) tempr+=a+b;
		for (int i=templ;i<=tempr;i++){
			flagc[flag[i]]=1;
		}

		int res=0;
		for (int i=1;i<=24;i++)
			res+=flagc[i];

		return res;

	}

	static boolean in(int[] a,int b,int l,int r){
		for (int i=l;i<=r;i++){
			if (a[i]==b)
				return true;
		}
		return false;
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author neuivn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            String s = in.nextLine();
            String t = in.nextLine();
            int id = 0;
            for (int i = 0; i < t.length(); ++i) {
                if (t.charAt(i) == s.charAt(id)) ++id;
            }
            out.println((id + 1));

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

    }
}


import java.util.*;
import java.io.*;
import java.text.*;
public class Main{
    //SOLUTION BEGIN
    //Into the Hardware Mode
    void pre() throws Exception{}
    void solve(int TC)throws Exception{
        int n = ni(), k = ni();

        int[] phi = new int[1+n];

        for(int i = 1; i<= n; i++){
            phi[i] += i;
            for(int j = i+i; j<= n; j+= i)phi[j] -= phi[i];
        }
        int[][] pair = new int[n-2][];
        for(int i = 0; i< n-2; i++)pair[i] = new int[]{i+3, phi[i+3]};
        Arrays.sort(pair, (int[] i1, int[] i2) -> Integer.compare(i1[1], i2[1]));

        long ans1 = 1, ans2 = 2, cnt1 = 0, cnt2 = 0;
        for(int i = 0; i< n-2 && cnt1 < k; i++){
            if(pair[i][0]%2 == 0)continue;
            ans1 += pair[i][1];cnt1++;
        }
        for(int i = 0; i< n-2 && cnt2 < k; i++){
            ans2 += pair[i][1];cnt2++;
        }
        long ans = IINF;
        if(cnt1 == k)ans = ans1;
        if(cnt2 == k)ans = Math.min(ans, ans2);
        pn(ans);
    }
    void add(int[] cnt, int x, int b){
        if(cnt[x] > 2 || b < 0)return;
       add(cnt, x, b-1);
       if(((x>>b)&1)==1){
           int nx = x^(1<<b);
           cnt[nx]++;
           add(cnt, nx, b-1);
       }
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    void exit(boolean b){if(!b)System.exit(0);}
    long IINF = (long)1e18, mod = (long)1e9+7;
    final int INF = (int)1e9, MX = (int)2e6+5;
    DecimalFormat df = new DecimalFormat("0.00000000");
    double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-6;
    static boolean multipleTC = false, memory = false, fileIO = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        if(fileIO){
            in = new FastReader("input.txt");
            out = new PrintWriter("output.txt");
        }else {
            in = new FastReader();
            out = new PrintWriter(System.out);
        }
        //Solution Credits: Taranpreet Singh
        int T = (multipleTC)?ni():1;
        pre();
        for(int t = 1; t<= T; t++)solve(t);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }

    int digit(long s){int ans = 0;while(s>0){s/=10;ans++;}return ans;}
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n()throws Exception{return in.next();}
    String nln()throws Exception{return in.nextLine();}
    int ni()throws Exception{return Integer.parseInt(in.next());}
    long nl()throws Exception{return Long.parseLong(in.next());}
    double nd()throws Exception{return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next() throws Exception{
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    throw new Exception(e.toString());
                }
            }
            return st.nextToken();
        }

        String nextLine() throws Exception{
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                throw new Exception(e.toString());
            }
            return str;
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Tanzim Ibn Patowary
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            for (int test = 0; test < testNumber; test++) {
                int a = in.nextInt();
                int b = in.nextInt();
                if (a == b) {
                    out.println(a);
                } else {
                    out.println(2);
                }
            }
        }

    }
}


import java.util.*;
import java.io.*;

/*
 * author:yanghui
 */
public class B {

	class FastIO {
		BufferedReader br;
		StringTokenizer st;
		PrintWriter out;

		public FastIO(File in, File o) {
			try {
				br = new BufferedReader(new FileReader(in));
				out = new PrintWriter(new FileWriter(o));
			} catch (Exception e) {
				e.printStackTrace();
			}
			eat("");
		}

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			eat("");
		}

		public void eat(String s) {
			st = new StringTokenizer(s);
		}

		public String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				throw new IOError(e);
			}
		}

		public boolean hasNext() {
			while (!st.hasMoreTokens()) {
				String s = nextLine();
				if (s == null)
					return false;
				eat(s);
			}
			return true;
		}

		public String next() {
			hasNext();
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public void print(String ans) {
			out.print(ans);
			out.flush();
		}

		public void print(int ans) {
			out.print(ans);
			out.flush();
		}

		public void print(long ans) {
			out.print(ans);
			out.flush();
		}

		public void print(double ans) {
			out.print(ans);
			out.flush();
		}

		public void println(String ans) {
			out.println(ans);
			out.flush();
		}

		public void println(int ans) {
			out.println(ans);
			out.flush();
		}

		public void println(long ans) {
			out.println(ans);
			out.flush();
		}

		public void println(double ans) {
			out.println(ans);
			out.flush();
		}

		public void println() {
			println("");
			out.flush();
		}

		public void printf(String arg0, Object... arg1) {
			out.printf(arg0, arg1);
			out.flush();
		}

		public void println(int[] ans) {
			for (int i = 0; i < ans.length; i++)
				print(ans[i] + " ");
			println();
		}

		public void println(long[] ans) {
			for (int i = 0; i < ans.length; i++)
				print(ans[i] + " ");
			println();
		}

		public void println(double[] ans) {
			for (int i = 0; i < ans.length; i++)
				print(ans[i] + " ");
			println();
		}

		public void println(Object... ans) {
			for (Object cur : ans)
				print(cur.toString() + " ");
			println();
		}

		public void println(Object ans[][]) {
			for (int i = 0; i < ans.length; i++) {
				println(ans[i]);
			}
		}

		public void println(int ans[][]) {
			for (int i = 0; i < ans.length; i++) {
				println(ans[i]);
			}
		}

		public void println(long ans[][]) {
			for (int i = 0; i < ans.length; i++) {
				println(ans[i]);
			}
		}

		public void println(double ans[][]) {
			for (int i = 0; i < ans.length; i++) {
				println(ans[i]);
			}
		}

		public void println(List<Object> ans) {
			for (Object i : ans) {
				print(i.toString() + " ");
			}
			println();
		}

		public void close() {
			out.flush();
			out.close();
		}
	}

	public static class ArrayUtils {
		public static void shuffleArray(int a[]) {
			int n = a.length;
			Random rnd = new Random();
			for (int i = 0; i < n; ++i) {
				int tmp = a[i];
				int randomPos = i + rnd.nextInt(n - i);
				a[i] = a[randomPos];
				a[randomPos] = tmp;
			}
		}

		public static void shuffleArray(long a[]) {
			int n = a.length;
			Random rnd = new Random();
			for (int i = 0; i < n; ++i) {
				long tmp = a[i];
				int randomPos = i + rnd.nextInt(n - i);
				a[i] = a[randomPos];
				a[randomPos] = tmp;
			}
		}

		public static void shuffleArray(double a[]) {
			int n = a.length;
			Random rnd = new Random();
			for (int i = 0; i < n; ++i) {
				double tmp = a[i];
				int randomPos = i + rnd.nextInt(n - i);
				a[i] = a[randomPos];
				a[randomPos] = tmp;
			}
		}

		public static void shuffleArray(float a[]) {
			int n = a.length;
			Random rnd = new Random();
			for (int i = 0; i < n; ++i) {
				float tmp = a[i];
				int randomPos = i + rnd.nextInt(n - i);
				a[i] = a[randomPos];
				a[randomPos] = tmp;
			}
		}

	}

//	FastIO scan = new FastIO(new File("in"), new File("out"));

	 FastIO scan = new FastIO();

	public void run() {

		String str = scan.next();
		int k = scan.nextInt();
		int len = str.length();

		int ans = 0;

		for (int i = 0; i < len; i++) {
			for (int j = i; j < len; j++) {
				int _len = j - i + 1;
				if (j + 1 + _len <= len) {
					String temp = str.substring(i, j + 1);
					String temp2 = str.substring(j + 1, j + 1 + _len);
					if (temp.equals(temp2))
						ans = Math.max(ans, _len * 2);
				} else {
					int _len2 = j + 1 + _len - len;
					if (_len2 > k)
						continue;
					else {
						_len = (len - 1) - (j + 1) + 1;
						String temp = str.substring(i, i + _len);
						String temp2 = str.substring(j + 1);
						if (temp.equals(temp2))
							ans = Math.max(ans, (j - i + 1) * 2);
					}
				}
			}
		}

		if(k >= len){
			ans = Math.max(ans, (len+k)/2 * 2);
		}

		scan.println(ans);

		scan.close();
	}

	public static void main(String args[]) throws Exception {
		new B().run();
	}
}


import java.util.*;

public class Main{

    int n,m;
    String a[][];

    public void run(){
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		m = in.nextInt();

		a = new String[n][m];
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++)
				a[i][j] = in.next();

		int cnt = 0;
		int i1 = -1, i2 = -1, j1 = -1, j2 = -1;
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++){
				if (a[i][j].equals("J1")){
					cnt++;
					i1 = i;j1 = j;
				}else if (a[i][j].equals("J2")){
					i2 = i;j2 = j;
					cnt++;
				}
			}

		if (cnt == 0){
			for(int i=0;i<=n-3;i++){
				for(int j=0;j<=m-3;j++){
					if (check(i, j)){
						for(int k=0;k<=n-3;k++){
							for(int l=0;l<=m-3;l++){
								if (isIn(i, j, k, l)) continue;
								if (check(k,l)){
									System.out.println("Solution exists.");
									System.out.println("There are no jokers.");
									System.out.println("Put the first square to (" + (k + 1) + ", " + (l + 1) + ").");
									System.out.println("Put the second square to (" + (i + 1) + ", " + (j + 1) + ").");
									return;
								}
							}
						}
					}
				}
			 }
		}else if (cnt == 1){
			HashSet<String> set = new HashSet<String>();
			String mast[] = new String[]{"C", "D", "H", "S"};
			String dost[] = new String[]{"2", "3","4","5","6","7","8","9","T","J","Q","K","A"};
			for(int i=0;i<mast.length;i++)
				for(int j=0;j<dost.length;j++)
					set.add(dost[j]+mast[i]);

			for(int i=0;i<n;i++)
			  for(int j=0;j<m;j++)
				set.remove(a[i][j]);
			if (i1 ==-1){
				i1 = i2;
				j1 = j2;
			}
			for(String s1:set){
				String tmp = a[i1][j1];
				a[i1][j1] = s1;
				for(int i=0;i<=n-3;i++){
					for(int j=0;j<=m-3;j++){
						if (check(i,j)){
							for(int k=0;k<=n-3;k++){
								for(int l=0;l<=m-3;l++){
									if (isIn(i, j, k, l)) continue;
								  	if (check(k, l)){
								  		System.out.println("Solution exists.");
								  		System.out.println("Replace " + tmp + " with " + s1 + ".");
								  		System.out.println("Put the first square to (" + (k+1) + ", " + (l + 1) + ").");
								  		System.out.println("Put the second square to (" + (i+1) + ", " + (j + 1) + ").");
								  		return;
								  	}
								}
							}
						}
					}
				}
				a[i1][j1] = tmp;
			}
		}else{
		 	HashSet<String> set = new HashSet<String>();
			String mast[] = new String[]{"C", "D", "H", "S"};
			String dost[] = new String[]{"2", "3","4","5","6","7","8","9","T","J","Q","K","A"};
			for(int i=0;i<mast.length;i++)
				for(int j=0;j<dost.length;j++)
					set.add(dost[j]+mast[i]);

			for(int i=0;i<n;i++)
			  for(int j=0;j<m;j++)
				set.remove(a[i][j]);

			for(String s1:set){
				for(String s2:set){
					if (s1.equals(s2)) continue;
					String tmp1 = a[i1][j1];
					String tmp2 = a[i2][j2];
					a[i1][j1] = s1;a[i2][j2] = s2;
					for(int i=0;i<=n-3;i++){
						for(int j=0;j<=m-3;j++){
							if (check(i, j)){
								for(int k=0;k<=n-3;k++)
								  for(int l=0;l<=m-3;l++){
								  	if (isIn(i, j, k, l)) continue;
								  	if (check(k, l)){
								  		System.out.println("Solution exists.");
								  		System.out.println("Replace J1 with " + s1 + " and J2 with " + s2 + ".");
								  		System.out.println("Put the first square to (" + (k+1) + ", " + (l + 1) + ").");
								  		System.out.println("Put the second square to (" + (i+1) + ", " + (j + 1) + ").");
								  		return;
								  	}
								  }
							}
						}
					}
					a[i1][j1] = tmp1;a[i2][j2] = tmp2;
				}
			}
		}
		System.out.println("No solution.");
    }

    private boolean check(int x, int y){
		int cnt = 0;
		for(int i=x;i<x+3;i++)
			for(int j=y;j<y+3;j++)
			if (a[i][j].charAt(1) != a[x][y].charAt(1))
				cnt++;

		if (cnt == 9) return true;
		HashSet<String> set = new HashSet<String>();
		for(int i=x;i<x+3;i++)
			for(int j=y;j<y+3;j++)
				set.add(""+a[i][j].charAt(0));

		if (set.size() == 9) return true;
		return false;
    }
	private boolean isIn(int x1, int y1, int x2, int y2){
		if (x1 <= x2 && x2 <= x1 + 2 && y1 <= y2 && y2 <= y1 + 2) return true;
		if (x1 <= x2 + 2 && x2+2 <=x1 + 2 && y1 <= y2 && y2 <= y1 + 2) return true;
		if (x1 <= x2 && x2 <=x1 + 2 && y1 <= y2+2 && y2 +2<= y1 + 2) return true;
		if (x1 <= x2+2 && x2+2 <=x1 + 2 && y1 <= y2+2 && y2 +2<= y1 + 2) return true;
		return false;
	}
    public static void main(String args[]){
		new Main().run();
    }
}


import java.util.*;
import java.io.*;

public class D {
    FastScanner in;
    PrintWriter out;

    public static void main(String[] args) {
        new D().run();
    }

    void solve() throws IOException {
        int n = in.nextInt();
        long m = 1; // one is bad number
        int[] primes = new int[n + 1];
        int[] primesMin = new int[n + 1];
        int primesCnt = 0;
        int[] sieve = new int[n + 1];
        for (int i = 2; i < n + 1; i++) {
            if (sieve[i] == 0) {
                primes[primesCnt++] = i;
                if (2 * i > n) {
                    m++;
                }
                int cnt = 0;
                for (int j = i; j < n + 1; j += i) {
                    if (sieve[j] == 0) {
                        sieve[j] = i;
                        cnt++;
                    }
                }
                primesMin[primesCnt - 1] = cnt;
            }
        }
        int[] prefPrimesMin = new int[n + 1];
        for (int i = 0; i < primesCnt; i++) {
            prefPrimesMin[i + 1] = prefPrimesMin[i] + primesMin[i];
        }
        boolean[] squareFree = new boolean[n + 1];
        squareFree[1] = true;
        for (int i = 2; i < n + 1; i++) {
            int prev = i / sieve[i];
            squareFree[i] = prev % sieve[i] != 0 && squareFree[prev];
//            out.print(squareFree[i] + " ");
        }
//        out.println();

        int[] countPrimeInDecomposition = new int[n + 1];
        for (int i = 2; i < n + 1; i++) {
            if (sieve[i] == 0) {
                countPrimeInDecomposition[i] = 1;
            } else {
                countPrimeInDecomposition[i] = 1 + countPrimeInDecomposition[i / sieve[i]];
            }
        }
        long sum1 = 0;
        for (int i = 2; i < n + 1; i++) {
            if (!squareFree[i]) continue;
            long cnt = n / i;
            cnt *= cnt;
            if (countPrimeInDecomposition[i] % 2 == 0) {
                sum1 -= cnt;
            } else {
                sum1 += cnt;
            }
        }
        long sum0 = 2 * (n - m) * m + m * (m - 1) + 1;
//        out.println(sum0);
        long sum3 = 0;
        int p1i = -1;
        for (int pi = 0; pi < primesCnt; pi++) {
            long p2 = primes[pi];
            if (p2 * 2 > n) {
                break;
            }
            if (p2 * p2 > n) {
                if (p1i == -1) {
                    p1i = pi;
                }
                while (p1i >= 0 && primes[p1i] * p2 > n) {
                    p1i--;
                }
                p1i++;
                sum3 += prefPrimesMin[pi] - prefPrimesMin[p1i];
            }
        }
        sum3 *= 2;
        long sum2 = (long) n * n - sum0 - sum1 - sum3;
//        out.println(m + " " + sum0 + " " + sum1 + " " + sum2 + " " + sum3);
        out.println((sum1 + sum2 * 2 + sum3 * 3 - (n - 1)) / 2);
    }

    void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}


import java.util.Scanner;

public class Game23 {

    public static boolean pure(int m) {
        while(m > 1) {
            if(m % 2 != 0 && m % 3 != 0) return false;
            if(m % 2 == 0) m /= 2;
            else if(m % 3 == 0) m /= 3;
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int moves = 0;
        if(!pure(m / n)) moves = -1;
        else if(m % n != 0) moves = -1;
        else {
            int value = m / n;
            while(value % 2 == 0) {
                moves++;
                value /= 2;
            }
            while(value % 3 == 0) {
                moves++;
                value /= 3;
            }
        }
        System.out.println(moves);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class march15 {

	public static void main(String[] args) {

		Scanner s=new Scanner(System.in);
		//System.out.println("enter elements");
		int[] arr=new int[4];
		for (int i = 0; i < arr.length; i++)
		{
			arr[i]=s.nextInt();
		}
		int count=1;
		Arrays.sort(arr);
		for(int i=0; i<3; i++)
		{
			if(arr[i]!=arr[i+1])
				count++;
		}
		System.out.println(4-count);
	}
}


import java.util.*;
import java.math.*;
import java.io.*;

public class Main{
	static Scanner in;
	public static void main(String[] args) throws IOException{
		in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();

		int arr[] = new int[n];
		for(int i=0;i<n;i++){
			arr[i] = in.nextInt();
		}

		int div = n/k;
		int[][] store = new int[div+1][k];
		int ptr = 0;
		for(int i=0;i<div;i++){
			for(int j=0;j<k;j++){
				store[i][j] = arr[ptr++];
			}
		}

		int a,b;
		for(int i=0;i<k;i++){
			a = b = 0;
			for(int j = 0;j<div;j++){
				if(store[j][i] == 1){
					a++;
				} else{
					b++;
				}
			}
			store[div][i] = Math.min(a,b);
		}

		int ans = 0;
		for(int i=0;i<k;i++){
			ans+=store[div][i];
		}

		System.out.println(ans);
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskD {
		public void solve(int testNumber, FastScanner in, PrintWriter out) {
			long n = in.nextLong();
			long inputL = in.nextLong() - 1;
			long inputR = in.nextLong() - 1;
			long k = in.nextLong();
			long d = dist(inputL, inputR, n);

			final long BIG = (long) 3e5;
			long ans = -1;
			if (n >= BIG) {
//		if (true) {
//		if (false) {
				// c full circles.
				for (long c = 0; n * c <= k; c++) {
					long l = -1;
					long r = n + 1;
					while (r - l > 1) {
						long m = l + (r - l) / 2;
						if (canLB(n, k, d, c, m)) {
							l = m;
						} else {
							r = m;
						}
					}
					if (l >= 0 && canUB(n, k, d, c, l)) {
						ans = Math.max(ans, l);
					}
				}
			} else {
				// s sweet lovers.
				for (long s = 0; s <= n; s++) {
					long minC = 0;
					long maxC = 0;
					{
						long b = Math.min(d, n - s);
						long a = d - b;
						long p = k - a - d;
						if (a > 0) {
							++p;
						}
						if (p < 0) {
							continue;
						}
						maxC = p / (n + s);
					}
					{
						long a = Math.min(d, s);
						long b = d - a;
						long p = k - a - d;
						p += n + s - 1;
						if (p < 0) {
							continue;
						}
						minC = p / (n + s);
					}
					if (minC <= maxC) {
						ans = Math.max(ans, s);
					}
				}
			}
			out.println(ans);
		}

		private boolean canLB(long n, long k, long d, long c, long s) {
			long minK = -1;
			long b = Math.min(d, n - s);
			long a = d - b;
			minK = (n + s) * c + d + a;
			if (a > 0 && minK > 0) {
				// Last "a" takes one.
				--minK;
			}
			return k >= minK;
		}

		private boolean canUB(long n, long k, long d, long c, long s) {
			long maxK = -1;
			long a = Math.min(d, s);
			long b = d - a;
			maxK = (n + s) * c + d + a;
			return k <= maxK;
		}

		private long dist(long l, long r, long n) {
			while (r < l) {
				r += n;
			}
			return r - l + 1;
		}

	}

	static class FastScanner {
		private BufferedReader in;
		private StringTokenizer st;

		public FastScanner(InputStream stream) {
			in = new BufferedReader(new InputStreamReader(stream));
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					String rl = in.readLine();
					if (rl == null) {
						return null;
					}
					st = new StringTokenizer(rl);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class VanyaAndBooks {
    public static void main(String[]args) {
        Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String str=s.next();
        int n=Integer.parseInt(str);

        long cnt=0;
        for(int i=10;i>=0;i--) {
            if (n >= Math.pow(10, i)) {
                long diff = (long) (n - Math.pow(10, i) + 1);
                cnt += diff * str.length();
                n-=diff;
                str=String.valueOf(n);
            }
        }
        System.out.println(cnt);
    }
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner myObj = new Scanner(System.in);
        String a = myObj.nextLine();
        BigInteger in = BigInteger.valueOf(Long.parseLong(a));
        BigInteger two = BigInteger.valueOf(2);
        BigInteger onr = BigInteger.valueOf(1);
        BigInteger p = BigInteger.valueOf(-1);
        BigInteger zero = BigInteger.valueOf(0);
        if (in.mod(two)==zero) {
            System.out.println(in.divide(two));
        }
        else {
            System.out.println(((in.divide(two)).add(onr)).multiply(p));
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class S_39I {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    List<List<Integer>> edges = new ArrayList<List<Integer>>();

    int[] depth;

    int dfs_GCD(int index, int d) {
        if (depth[index] == 0) {
            depth[index] = d;
            int rv = 0;
            for (int next : edges.get(index)) {
                rv = gcd(rv, dfs_GCD(next, d + 1));
            }
            return rv;
        } else {
            return d - depth[index];
        }
    }

    private static int gcd(int a, int b) {
        a = Math.abs(a);
        b = Math.abs(b);
        while (b != 0) {
            int t = a % b;
            a = b;
            b = t;
        }
        return a;
    }

    void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        for (int i = 0; i < n; ++i) {
            edges.add(new ArrayList<Integer>());
        }
        for (int i = 0; i < m; ++i) {
            int s = nextInt() - 1;
            int e = nextInt() - 1;
            edges.get(s).add(e);
        }
        depth = new int[n];
        int gcd = dfs_GCD(0, 1);
        List<Integer> ans = new ArrayList<Integer>();
        for (int i = 0; i < n; ++i) {
            if (depth[i] % gcd == depth[0] % gcd && depth[i] != 0) {
                ans.add(i + 1);
            }
        }
        out.println(gcd);
        out.println(ans.size());
        for (int i : ans) {
            out.print(i);
            out.print(" ");
        }
    }

    public void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        eat("");
        solve();
        out.close();
        in.close();
    }

    void eat(String s) {
        st = new StringTokenizer(s);
    }

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            eat(line);
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) throws IOException {
        new S_39I().run();
    }
}


import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class ProblemC {

    /**
     * @param args
     * @throws IOException
     */

    public static void main(String[] args) throws IOException {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        sc.nextInt();
        char[] num = Long.toString(sc.nextLong()).toCharArray();
        StringBuilder b = new StringBuilder();
        for (int i = 0; i < num.length; i++) {
            if (num[i] == '2') {
                b.append("2");
            } else if (num[i] == '3') {
                b.append("3");
            } else if (num[i] == '4') {
                b.append("223");
            } else if (num[i] == '5') {
                b.append("5");
            } else if (num[i] == '6') {
                b.append("35");
            } else if (num[i] == '7') {
                b.append("7");
            } else if (num[i] == '8') {
                b.append("2227");
            } else if (num[i] == '9') {
                b.append("2337");
            }
        }
        char[] needed = b.toString().toCharArray();
        Arrays.sort(needed);
        needed = reverse(needed);
        System.out.println(Arrays.toString(needed).replace("[", "").replace("]", "").replace(",", "").replace(" ", ""));
    }

    private static char[] reverse(char[] needed) {
        // TODO Auto-generated method stub
        char [] opa = new char[needed.length];
        for (int i = 0; i < opa.length; i++) {
            opa[i]=needed[opa.length-i-1];
        }
        return opa;
    }

}


import java.util.Scanner;
import java.util.*;
import java.io.*;
import java.math.*;

//********************************************************K.S.J_@@@@@@@@@@@@@@@@@@@@@@@@@****************************

public class kthDivisor{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	static void inputArrayInt(int arr[],int size)throws IOException{for(int i=0;i<size;i++)arr[i]=nextInt();}
	static void inputArrayDouble(double arr[],int size)throws IOException{for(int i=0;i<size;i++)arr[i]=nextDouble();}
	static void inputArrayLong(long arr[],int size)throws IOException{for(int i=0;i<size;i++)arr[i]=nextLong();}
	static void inputArrayString(String arr[],int size)throws IOException{for(int i=0;i<size;i++)arr[i]=nextLine();}

	public static void main(String args[]) throws IOException{
		init(System.in);
			long no=nextLong();
			int k=nextInt();
			int c=-1;
			long sq=(long)Math.sqrt(no);

			ArrayList<Long> Darr=new ArrayList<Long>();
			HashSet<Long> hs=new HashSet<Long>();
			if(sq==1){Darr.add((long)1);}
				else{
						for(long i=1;i<=sq;i++){
							if(no%i==0 && !hs.contains(i)){Darr.add(i); hs.add(i);
								if(i<=sq && !hs.contains((long)no/i)){Darr.add((long)(no/i));}
							}
						}
						Collections.sort(Darr);}
			//Darr.add(no);
			int l=Darr.size();
			//System.out.println(Darr);
			//System.out.println(l);
			if(l<k){System.out.println("-1");return;}
			else{System.out.println(Darr.get(k-1));}

			}

}


// No sorcery shall prevail. //
import java.util.*;
import java.io.*;
public class _InVoker_ {
	//Variables
	static long mod = 1000000007;
	static long mod2 = 998244353;
	static FastReader inp= new FastReader();
	static PrintWriter out= new PrintWriter(System.out);
	public static void main(String args[]) {
	   	_InVoker_ g=new _InVoker_();
	   	g.main();
	   	out.close();
	}

	long pref[];

	//Main
	void main() {

		int n=inp.nextInt();
		long a[]=new long[n];
		input(a,n);
		if(n>66) {
			out.println(1);
			return;
		}
		pref=new long[n+1];
		pref[1]=a[0];
		for(int i=1;i<n;i++) pref[i+1]=pref[i]^a[i];
		int gg=34;
		for(int c=0;c<n-1;c++) {
			for(int left=c;left>=0;left--) {
				for(int right=c+1;right<n;right++) {
					if(xor(left,c)>xor(c+1,right)) gg=Math.min(gg, right-left-1);
				}
			}
		}
		out.println(gg==34?-1:gg);

	}

	long xor(int i, int j) {
		return pref[j+1]^pref[i];
	}

	/*********************************************************************************************************************************************************************************************************
	 * ti;.                               .:,:i:         :,;;itt;.        fDDEDDEEEEEEKEEEEEKEEEEEEEEEEEEEEEEE###WKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWW#WWWWWKKKKKEE      :,:.    f::::. .,ijLGDDDDDDDEEEEEEE*
	 *ti;.                               .:,:i:          .:,;itt;:      GLDEEGEEEEEEEEEEEEEEEEEEDEEEEEEEEEEE#W#WEKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKKKKKKG.     .::.      f:,...,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:            :,;;iti,    :fDDEEEEEEEEEEEEEEEKEEEEDEEEEEEEEEEEW##WEEEKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWWKKKKKKEG     .::.       .f,::,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:             .,,;iti;.  LDDEEEEEEEEEEKEEEEWEEEDDEEEEEEEEEEE#WWWEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWKKKKKEDj    .::.        .:L;;ijfGDDDDDDDDDEEEEE *
	 *ti;.                               .:,:i:              .:,;;iii:LLDEEEEEEEEEEEKEEEEEEEEDEEEEEEEEEEEW#WWEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWKWWWWWWWWWWWWWWKKKKKKKEL    .::.         .:;LijLGGDDDDDDDDEEEEE *
	 *ti;.                               .:,:;:                :,;;ittfDEEEEEEEEEEEEEEEEKEEEGEEEEEEEEEEEKWWWEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWKKKKKKKELj   .::.          :,;jffGGDDDDDDDDDEEEE *
	 *ti;.                               .:,:i:                 .,;;tGGDEEEEEEEEEEEKEEEKEEEDEEEEEEEEEEEEWWWEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWKWWWWWWKKKKKKKEEL   .::.          .:;itDGGDDDDDDDDDEEEE *
	 *ti;.                               .:::;:                   :;ifDEEEEEEEEEEEEKEEEKEEEEEEEEEEEEEEEWWWEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WWWKKKKKKKKEEf   .::.           :,itfGEDDDDDDDDDDDEE *
	 *ti;.                               .:::;:                    :GGEEEEEEEEEEEKEKEEKEEEEEEEEEEEEEEEEWWEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKKEEDG  .::.           .,;jfLGKDLDDDDDDEEDD *
	 *ti;.                               .:::;:                     fDEEEEEEKKKKKKKKKEKEEEEEEEEEEEEEEE#WEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#KKKKKKKKKKEEf .:::.           .,;tfLGDEDDDDDDDDEEE *
	 *ti;.                                :::;:                    fDEEEEEEKKKKKKKKKKWKEEEEEEEEEEEEEEEWKEEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKKKEEft :::.           .,;tfLGDDDKDDDDDDDDD *
	 *ti;.                                .::;:                    fDEEEEEEKKKKKKKWKKKKKEEEEEEEEEEEEE#WEEWEEEEEDEEDEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKEEGG :,:.           .,;tfLGGDDDKDDDDDDDD *
	 *ti;.                                .:.;:                   tGDEEEEKKKKKKKKKKKKKKKKKEEEEEEEEEEEWEEKWEEEEEEEDEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKKKKKEEDf :::.           .,;tfLGGDDDDEDDDDDDD *
	 *ti;.                                .::;:                   fDEEEEEKKKKKKKKKKKWKKKKKKKKEEEEEEEWWEEWEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKEEEft.::.           .,;tfLGGDDDDDDEDDDDD *
	 *ti;.                                .:.;:                  tGDEEEKKKKKKKKKKKKKKKKKKKKKKEKEEEEE#EEWWEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKEEEGD:::.           .,;tfLGGDDDDDDDEDDDD *
	 *ti;.                                .:.,.                  LDEEEEKKKKKKKKKKWKWKKKKKKKKKKKKEEEKWEKW#EEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKW##KKKKKKEEEEf,,:.           .,;tfLGGDDDDDDDDEDDD *
	 *ti;.                               ..:.,.                 LGDEEEEKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEEW#WEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKK##KKKKKEEEEEfi;,.           .,;tfLGGDDDDDDDDDKDD *
	 *tt;.                                .:.,:                 jDEEEEKKKKKKKKKKWWKKKKKKKKKKKKKKKKKWKE#WWEEEEEEEEEEEEEEWEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKWWKKKKEEEEDfG;,:           .,;tfLGGDDDDDDDDDDKD *
	 *tii,.                               .:.,.                tGDEEEEKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKKWWWKEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKW#KKKKEEEEDGGi;,.          .,;tfLGGDDDDDDDDDDDE *
	 *ti;;,:.                             .:.,:                fDEEEEKKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEK#WWKEEEEEEEEEEEEDEEEEEEEEEEEEEEGEEEEEEEEEEEEEEEEEEEKKKKKKKWWKKEEEEEEDDf;;;,.         .,;tfLGGDDDDDDDDDDDD *
	 *tii;,,:..                           ...,.               ;LEEEEEKKKKKKWKKKKWKKKKKKKKKKKKKKKKKEKKW#WEEEEEEEEEEEEEjEEEEEEEEEKEEEEGEEEEEEEEEKEEEEEEEEEEEEEEEEE#WKEEEEEEDDf;;;;,:        .,itfLGGDDDDDDDDDDDD *
	 *ti;,,,,,:.                          ...,.               LDEEEEKKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKK#W#WEEEEEEEEEEEDDLEEEEEEEEEWEEEEDEEEEEEEEEKEEEEEEEEEEEEEEEEEWWEEEEEEEDDfj,,,,,:.      .,itfGGGDDDDDDDDDDDD *
	 *tii,,,,::::.                        ...,:              .fDEEEEKKKKKKWKKKKWWWKKKKKKKKKKKKKKKEKKW#WWEEEEEEEEEEEKiKEEKEEEEEEWEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEEWWEEEEEEEDDLD:::,,,:.     .,ijfGGGDDDDDDDDDDDD *
	 *ti;:::::::::..                      .:.,:              LDEEEEKKKKKKKWKKKKWWKKKKKKKKKKKKKKKKtKKWWWWKEEEEEEEEEDiiDEEEEEEEEWWEEEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEWKEEEEEDDDGL:. .:,,,:    .,ijLGGGDDDDDDDDDDDD *
	 *tt;. .::::::::..                    ...,:             :fDEEEKKKKKKKKKKKKWW#KKKKKKKKKKKKKKKKfKKWWWWKEEEEEEEEDti,DEKEEEEEEWWEEEDEEEEEEEEEKEEEEEEEEEEEEEDEEEEE#WEEEEEGGDGf:.  .:,;,:.  .,ijLGGDDDDDDDDDDDDD *
	 *tt;.   .:::::::..                   ...,:             GDEEEKKKKKKKKWKKKKWWWKKKWKKKKKKKWWWKDEKLWWWWKKEEEEEEDEi,LDEEEEEEEEWWEEEEEEEEEEEEEEEEEEEEEEEEEDEDEEEEEW#EEEEDDDDGf,.    :,,,:...,ijLGGGDDDDDDDDDDDD *
	 *tt;.    .....::::..                 ...,:             fDEEEKKKKKKKKWKKKKWWWWKKKWKKKKKKKKKKfWKiWWW#KKEEEEEEEi;.EDfEEEDEEiWWEEEEEEEEEEEEDGKEEEEEEEEEEDEEEEEEEWWEEEEDDDGGLi.     .,;,:::,ijLGGGDDDDDDDDDDDD *
	 *tt;.      ....:::::.                ...,.            iDEEEEKKKKKKKKWKKWKWWWWWKKWWWKKKKKKKKtWKt#WWWKKEEEEEDji..DDKDDEDEGiWKEEEEEEEEEEDDEjEEEEEEEEEEEDEEEEEEEKWKEEDDDDGGff.      .:,;,,;ijLGGGDDDDDDDDDDDD *
	 *tt;.        ....::::..              .:.,:           .LDEEEKKKKKKKKKKKKWWWWKWWWWWWWWWWKKKKWtKKiDWWWKKKEEEEKi:..DEDDDDDDiiWKEEEEEEEEEEDDEijDEEEEEKEEEEEEEEEEEEWWEEGDDDGGLG.       .:,;;iijLGGGDDDDDDDDDDDD *
	 *tt;.          .....:::..            ...,.           .fEEEEKKKKKKKKWKKKKWWWWWWWWWWWWWWKWKKKiKDiLWWWWKEEEEEi,..fD:DDDDDti;WEEEEEEEEEEKDDi:iDDEEEEWEEEEEEEEEEEE#WEEGDDDDGGG.         :,iitjLGGGDDDDDDDDDDDD *
	 *tti.            .....:::..          ...,.           GDEEEKKKKKKKKKWKKKWWW#WWWWWWWWWWWKWKKjiEjitWWWKKWEEEDi...DDLDDDDji;;WEEEEEEEEEEEDEj.iDDEEEEWEEEEEEEEEEEEWWEEDDDDDDGf.          .,;tjfLGGDDDDDDDDDDDD *
	 *tti.              ....::::..        ...,.           fEEEKKKKKKKKKKKKKKKW#WWWWWWWWWWWWWWWWtiEiiiWWWKKEWKEi....D.EDDDEi;.fWEEEEEEEEEEDDfL.;EDDEEEWEEEEEEEEEEEEWWEEEDDDDDGf.           :;ijfLGGDDDDDDDDDDDD *
	 *tti.                ....::::..      ...,.          LDEEEKKKKKKKKKKKKKKWWWWWWWWWWWWWWWW####WKiiiWWWKKKEEK,...:E:DDDEii..GWEEEEEEEEDWDDiL.,KDDEEEWEEEEEEEEEEEEWWKEEDDDDDGf:           .,itfLGGDDDDDDDDDDDD *
	 *tti.                 .....:::..     ...,.          fDEEEKKKKKKKKKWKKKKWWWWWWWWWWWWW########WLiiWWWKKKEEjD...G,DDDDi;...EWEEEEEEEEDKDEii..LDDEEEWEEEEEEEEEEEEWWWEEDDDDDGfi           .,;tfLGGGDDDDDDDDDDD *
	 *tti.                   .....:::..   ...,.         iGEEEKKKKKKKKKKWKKKKWWWWWWWWWWWW###########KiWWWKKEEE,.D..D.DDDii:...KKEEEEEEEEEDDj:...tEDEEEWEEEEEEEEEEEEWWWEEEDDDDDLL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                     ....::::......:.         LEEEKKKKKKKKKKWWKKKWWW#KWWWWWWWW#####W####W##KWWKKEEL..:D.jjDDi;,....KKEEEEEEEDfDDi...:iKDEEEWKEEEEEEEEEEEWWWEEEEDDDDLG           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                        ...::::::..,.        :GEEEKKKKKKKKKKKKWWWWW##WWWWWWWWW##WKWK#W#W####WWKEEK.....G.DDti,.....KKEEEEEEDWGDf.,...iKDEEEWWEEEEEEEEEEEW#WEEEEEDDDGL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                         ....::::::,.        GDEEKKKKKKKKKKKKKWWWW###WWWWWWWWWW#WWWK###W#####WKEKK.....jDDL;;......KKEEEEEEEEEDi.f...;KDEEEWWEEEEEEEEEEEWWWWEEEEEDDGf           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                           ....:::,,.       .LEEEKKKKKWKKKKKWWWWWW###WWWWWWWWWW#WWKW#WW##W#WWWKEKD:....:DD:;......;KEEEEEEEKiDD..f...,KKEEEWWEEEEEEEEEEEWWWWEEEEEDDDf           .:;tjLLGGGDDDDDDDDDD *
	 *tti.                             ...::,,,:.     GDEEKKKKKKKKKKKKWWWWWWW#WWWWWWWWWWW#KjKWWWWWWWWWWWWEK.j,..;fD.;.......fKEEEEEDKG:Di..,....DKEEEWWEEEEEEKEKKKWWWWEEEEEEDDf           .:;tjLLGGDDDDDDDDDDD *
	 *jti.                              ...::,,,,:.  .fEEEKKKKKWKKKKKKWWWWWWW#WWWWWWWWWWK#KKKWWWWWWWWWWWWWK..f:.:G.,:.......EKEEEEEKK;:E:.......fKEEEWWKEKEKKKKKKKW#WWEEEEEEDDf:          .,;tfLLGGDDDDDDDDDDD *
	 *tti.                               ...:,,,;;,: iDEEKKKKKWKKKKKKKWWWWWWW#WWWWWWWWWWK#WDKWWKKWWWWWWWWWE..;G:G..,........KKEEEEEKi.Gi..:.....tKEEKWWWKKKKKKKKKKW##WKEEEEEEDfi          .,;tfLLGGGDDDDDDDDDD *
	 *tti.                               ....::,,;;;,LEEKKKKKKWKKKKKWWWWWWW###WWWWWWWWWWKWWDKWEEEWKKWWWWWKKj.:LG..;.........EKEEEEKG;.G...;.....;KKEKWWWKKKKKKKKKKW##WWKEEEEEDfL          .,;tfLGGGDDDDDDDDDDD *
	 *jti.                                ...::::,;ijDEEKKKKKWKKKKKKWKWWWWW##WWWWWWWWWWWKK#KKGDGDWEEWKKWKKGE,.i;.:.........:EKEEEKE;.:L...j.....,KWEKWWWKKKKKKKKKK####WKKEEEEDLG          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:...,,;GEEKKKKKWWKKKKKWWWWWWWW###WWWWWWWWWKKKWWKiLGGEDEDEKGKKiEG..;...........jKEEEKK;:.G....,.....:KKEWWWWKKKKKKKWKK####WKKKKEEEGL          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:.  .:,GEEKKKKKWKKKKKWWWWWWWW####WWWWWWWWWKKKWWKii;fDLGDK: EEi:E:.............EKEEKK;;..L...........KKKWWWWKKKKKKKWKK####WKKKWKEEDf          .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    ,EEKKKKKWWKKKKKWWWWWWWWW###WWWWWWWWKKKKfWWLt;i,. fi  EG..D:.............EKEKK;;..t....:.......KWKWWWWKKKKKKKWKK####WKKKWEEEDf:.        .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEEKKKKKWKKKKKWWWWWWWWW####WWWWWWWKKKKKt;KKEfff     .;t.................KKKKi;:..GtGGfG.......KWWWWWWKKKKKKKWKK###WWWKKKKEEEf,,:       .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEKKKKKWWKKKKKWWWWWWWWWW##WWWWWWWKKKKKKt;EiKKKK,   ...t................jEKKG;;..,.....,LGi....KWWWWWWKKKKKKWKKKW####WKKKKKEEL,,,:.     .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  .GEEKKKKKWKKKKKWWWWWWWWWW###WWWWWWWKKKKKKtiE::tGG........................EEEj;;...,.........:D..DKWWWWWWKKKKK#KKW###W#WKKKKKEEfj:,,,:.   .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.   DEKKKKKWWKKKKKWWWWWWWWW####WWWWWWWKKKKKKiiE:::.::.......................EEi;;...j.....f......:iDKWWWWWWKKKKK#WW######WKKKKKEELG :,,,,:. .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  fEEKKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKK;tE::..........................DD;.;,.::......;........EWWWWWWWKKKKW#WW#####WWKKKWKKELG  .:,,,:::,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. .DEKEKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKE,iD::..........................D..,;.,;tLffi...........DWDWWWW#KKKWWWWW#####W#KKKWKEEGL    .:,;,,,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. ;EEKKKKWWKKKKKWWWWWW#WWWW####WWWWWWKKKKKEL:iD:..........................j ..;..;;:.....i,........DKtWWWWWKKWWWWWW#####WWWKKKEKEDf     .:,;;;itfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. DEKKKKKWWKKKKWWWWWWW#WWWW####WWWWWWKKKKKEj:iG...............................:....................GKiWWWWWKKWW#WWW######WWKKKKKEEf       .,;iitfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.:EKKKKKWWKKKKKWWWWWWW#WWW#####WWWWWKWKKKKEi:if:.................................iEKEKKKKKKDj......DKiWWWWWKWK##WW#######WWKKK:KEEL        .:;itfGGGDDDDDDDDDDDD *
	 *jji.                                ...:,DEEKKKWWWKWKKWWWWWWWWWWWW#####WWWWWWWKKKKEi:it..................................j.  KKKKKKKKKKKf..DKiWWWWWKWW##WW#######WWKKK,KEEf         .,;tfGGGDDDDDDDDDDDD *
	 *jji.                                ..L:iDEEKKKWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKKi.i;..................................  . KKKWWWWWWWWK..DGiWWWWWKK##WWW#####W#WWKKKjEKEL,        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                               .f:::EEEKKKWWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKK;.i,.................................::  KKEKWWWWWWfWK..EiiWWWWWKWW#WW##########KKKD,KELj        .:;tfGGDDDDDDDDDDDDD *
	 *jji.                             .t::::,DEEKKKWWKKKKWWWWWWWWW#WWWW#####WWWWKKWKKKEK;.i:.................................GDDEEEKKKWWWWWtWWD.E;iWWWWWW###WW#########WWKKK.EEDG        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                          . j..::::EKEKKKWWWKKKKWWWWWWWWW#WWW######WWWWKKWKKKEK;.t:.................................ELLEDDEEEWWWWEtWK,.KiiWWWWWW###W##########WWKKK:EEEG     .;tjfLLGDDDDDDDDDDDDDDD *
	 *jji.                          i.::::::,EEEKKWWWKKKKKWWWWWWWWW#WWW#####WWWWWKWKKKKEE,.t..................................DfiEGDDDEEKKKttKWG.KiiWWWWW##WWW##########WWKKK:fEEL  ,fGGGDDDDDDDDEEEDDDDDDDDDD *
	 *jji.                        .;:..:::::DEEEKKWWWKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKED,.t..................................ifjDDGGEGDKK.ttKKE.DiWWWWW###WW##########WWWKKK:.KELiLGGGGDDDDDDDDDDDDEEEDDDDDDD *
	 *jji.                       i.:.::::::,KEEKKWWWKKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKEL:.j..................................GGf,;ifLLED .iiKKi:fWWWWWW##W#W##########WWWKKK:.KKLGGDDDDDDDDDDDDDDDDEDDEEDDDDD *
	 *jji.                     .j:.::::::::EEEKKKWWWKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKf:.f..................................:EEfftf .,. ;iE,..jWWWWWWW###W############WWKKK,:KKGDDDDDDDDDDDDDDDDDDDDDDDEDDDD *
	 *jji.                    .:.::::::::,,EEEKKWWWKKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKt..G....................................EEELL;   .j....tKWWWWWWW################WWWKKtfGKGEDDDDDDDDDDDDDDDDDDDDDDDEEDD *
	 *jji.                   :...:::::::,,jEEKKWWWWKKKKKKWWWWWWWWW##KWW#####KWWWWWWKKKKEi..D....................................:jEEE.........;KKWWWWWWWW#WW##W##########WWKKDLGKEKDDDDDDDDDDDDDDDDDDDDDDDDDED *
	 *jji.                  i:.::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWW##WWW#####WWWWWWWKKKKKi..D......................................:::::......,KKKWWWWWWWWW#####W########WWWKKKGGKKEGGGGGGGGDDDDDDDDDDDDDDDDDDE *
	 *jji.                 i..:::::::::,,tEEKKWWWWKKKKKWWWWWWWWWWW##WW######WWWWWWWKKKKKi..D......................................::::......:EKKKWWWWWWWWWWW##WW########W#WKKWGGKKGGGGGGGGGGGGGGGDDDDDDDDDDDDD *
	 *jji.                .:::::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWWW##WW#####WWWWWWWWKKKKKi..D....................................:::::::::..tELii;KWWWWWWWWWW##WW######WWWWWWKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGDG *
	 *jjt.                :.::::::::,,,,fEEKKWWWWKKKKKKWWWWWWWWWW###WW####WWWWWWW#WKKKKKi..D....................................:::::::.:.,;;;;;;,KKWWWWWWWWW#WW########WWWKKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *jji.               ;.::::::::,,,,;EEEKWWWWWKKKKKWWWWWWWWWWWW##WW###WKWWWWWK#WKKKKKi..G......................................:::::::,;;;;:...KKKWWWWWWWWWKWW#######WWWWKKGLGKDGGGGGGLLGGGGGGGGGGGGGGGGGGG *
	 *jjt.              f.:::::::::,,,,fEEKKWWWWWKKKKKWWWWWWWWWWW###WW##WKKWWWWWW#WKKKKK;.jt........i.............................:::::::;j;;....:E.KKKWWWWWWWKWW#####W#WWWWKKLLGWEEGGGGGLGGGGGGGGGGGGGGGGGGGG *
	 *jjt.             ...:::::::,,,,,;DEEKWWWWWKKKKKWWWWWWWWWWWW####WWWKKKWWWWWWWWKKKKK;.E;.........t.............................:::::ii;;.....D...KKWWWWWWWKWW#####WWEWWWKKGGGEKKGGGGGLGGGGGGGGGGGGGLGGGGGG *
	 *fji.             ;.:::::::,,,,,;LEEKKWWWWWKKKKKWWWWWWWWWWWW####KWKKKKWWWWWWWWKKKKKi.D;..........j.............................:::tt;,.....:.....KKWWWWWWKWWWW##WWWGWWWKKGGGGKEGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fji.            t::::::::,,,,,,;EEEKWWWWWKKKKKKKWWWWWWWWWWW##WKWKKKKKWWWWWWWWKKKKKi:D;............j...........................::LL;,.............KKWWWWWKWWWWWWWWWGWWWKKGGGGKGGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fjt:            .:::::::,,,,,,,DEEKWWWWWWKKKKKKKWWWWWWWWWWWWKKWKKKKKKWWWWK#WWKKKKWitE;........... ............................:G;;:...............KKKWWKKWWWWWWWWWGWWWKKGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGL *
	 *fjji;:.       .f:::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWWKKKKKKKKKKKWWKWWWWWKKKKWGKD;........................................L;;..................DKKWKKWWWWWWWWWGWWWKKDGGGKDGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *fjjtii;,:.     :::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWKKKKKKKKKKKKWWWWWW#WWKKKKWiEj;......................................:i,;....,...............;KKEKWWWWWWWWWGKWWKKDDGGDEGGGDGGGGGDGGGGGGGGGGGGGGGG *
	 *fjtiiiii;;:.  j::::::,,,,,,,;;EEEKWWWWW#KKKKKWWWWWWWWWKKKKKKWKKKKKKKWWWWWWWWWKKKKWtEL;:....................................;;;:...,;j................:KEEWWWWWWWWWDDWWKKDDDDDKDDDDDDDDDDDDDDDGGGGGGGGGGG *
	 *fjti;;iiii;;,:::::::,,,,,,,,;EEEKWWWWWWWKKKKWWWWWWWWKKKKKKKWKKKKKKKWWWWWWW#W#KKKKWEEii;...................................f;:....,;L...................EEKWWWWWWWWDDWWKKDDDDDKEDDDDDDDDDDDDDDDDDDDDDGGGG *
	 *fjt,,,;;;;ii;f::::::,,,,,,,;;EEKWWWWWWWKKKKKWWWKWWKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWKEij;:...............................:G;,.....,;f....................:tKKWWWWWWWDDWWKKDDDDDKKDDDDDDDDDDDDDDDDDDDDDDDDD *
	 *jjt. ..:,;;;;,::::,,,,,,,,;;GEEWWWWWWWWKKKKWKKWKKKKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWEDi;j;............................,Li;L;;;..,;;f........................KKKKWWWKDDWWKKDDDGDKKGGGGGGGGDGDDDDDDDDDDDDDDD *
	 *fjt.    .:,,,:::::,,,,,,,;;;EEKWWWWWWWKKKKKKWKKKKKKKKKKKKKKKKKKKKKWKKKWKW##W#KKKKWEti;;G;........................tEEEL;;;;;;;;;;L..........................DKKKKKEDDWWKEDGftiLE;;;;itjLGGGGGGDDDDDDDDDDD *
	 *fjt.       .j::::,,,,,,,;;;DEEWWWWWWWWKKKKWKKKKKKKKKKKKKKKKKKKKKKKWKKWWWK##W#KKKKKEii;;;L;...................iDEEEEEEKKi;j;;;;jD.....:......................,KKKKDGGEKKE:::::;E::::::::::,tLGGDDDDDDDDDD *
	 *fjt.       .;:::,,,,,,,;;;;EEKWWWWWWWWKWKKKKKKKKKKKKKKKWKKKKKKKKKKWKKWWWW#WW#KKKKKKii;;;;f;.............:tDEEEEEKKKKKKKKEti;;;L...............................EEKf;:iKKE::::::E::::::::::::::ifDDDDDDDDD *
	 *fjt:        :::,,,,,,,,;;;DEEWWWWWWWWWEKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####KKKKKEiii;;;;f,.........iDEEEEKKKKKKKKKKKKKKKf;iG......i..........................fK::::KKE::::::E::::::::::::::::,tGGDDDDD *
	 *fjt:       t:::,,,,,,;;;;iDEKWWWWWWKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####WKKKKLiii;;;;;L,....,Li;EDEEEEKKKKKKKKKKKKKKKKiG......;:...........................:i:::KKE:::::,E,::::::::::::::::::iGDDDD *
	 *jjt.       f::,,,,,,,;;;;GEEWWWWKEEKEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKWWWWW###WWKKKKiii;;;;;;;G,;L;;iiEEEEEEEKKKKKKKKKKKKKWWKE......;t.........:....................j::KEE:,::,,D,,::::,,,,,,:::::::::tDDD *
	 *fjt:.      ,::,,,,,,,;;;;EEWWKEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKKWWWWW#W#KKKKKKiiiiii;;;;;i;;iiiEEKEEKKWKKKKKKKWKKKKKWWWGi;...;t......,;;;;,....................:,EEE,,,,,,D,,,,,,,,,,,,,,,,::,::::tG *
	 *fjt:.     ,::,,,,,,,;;;;DEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWW#W#KKKKKKiiiii;;i;;;;;iiiKKKEKKKKWWKWWWWWWKKKKWWWWW;;;:;L.....;;;;;;;;;....................,KEE,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,; *
	 *fjt:.     f:,,,,,,,;;;;jEDEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWW#W##KKKKKKiiiiiiii;i;;iiiEKKKKKKKKWKWWWWWWWWKKKWWWWWKi;;i.....,jEEfGi;;;;;...................EED,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.    .f::,,,,,,;;jEEDEEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWKWWWWW###KKKKKLiiiiiiiiiiiiiiEEKKKKKKKKWWWWWWWWWWWWKWWWWWWGi;i;,..;jDDDKEGi;;;;;;:................EED,,,,,,D,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.  .. ;::,,,,,;;EDDEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKW#WW####KWKKKiiiiiiiiiiiiijKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWt;i;;;;i;DDDDDDGi;;;;;;;;:.............EDf;,,,;,G;;;;;;;;;;;;;;;,,,,,,,,,, *
	 *fjt:......:,,,,,,;LDDDEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWWKWWWW####KKKKKiiiiiiiiiiijKEKKWKKKKKKKWWWWWWWWWWWWWWWWWWWWWWiLiii;i;DEEEEDDE;i;;;;;;;;;:..........EDi,;;;;;L;;;;;;;;;;;;;;;;;;,,,,,,, *
	 *fjt:......:,,,,,;EDDDEEKEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKWWWWKKWWW##W#KWKKWEiiiiiijGKKKKKWWKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKi;iiiiDDEEEEEEDEi;;;;;;;;;;;;;,:.....ED;;;;;;;j;;;;;;;;;;;;;;;;;;;;;;;,, *
	 *fjt:.....t,,,,,;DDDDEEEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKWWWW##WKWKKWKiiiKKKKKKKKKWWKKKKKKKKWWWWWWWWWWWWWWW#WWWWWWWWWiiiiifLEEEEEEEEDi;i;;;;;;;;;;;;.....DD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....G,,,,,GDDDEEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKKWWWKKKWWW###WKWKKWKitKKKKKKKKKWKKKKKKKKKKWWWWWWWWWWWWWW###WWWWWWWWEiiiiiiiEEEEEEEEDGiiii;;;;;;;;;.....GD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....L,,,,;GDDDEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWDGWWW###KKWWKWKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWW####WWWWWWWWWiiiiiiiiEEEEEEEEEEDi;i;;;;;;;;.....Lj;;;;;;i;iiiiii;;;;;;ii;;;;;;;;;;; *
	 ***********************************************************************************************************************************************************************************************************/

	void sort(int a[]) {
		ArrayList<Integer> list=new ArrayList<>();
		for(int x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void sort(long a[]) {
		ArrayList<Long> list=new ArrayList<>();
		for(long x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void ruffleSort(int a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			int temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}
	void ruffleSort(long a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			long temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st==null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String s="";
            try {
                s=br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }

	long fact[];
	long invFact[];
	void init(int n) {
		fact=new long[n+1];
		invFact=new long[n+1];
		fact[0]=1;
		for(int i=1;i<=n;i++) {
			fact[i]=mul(i,fact[i-1]);
		}
		invFact[n]=power(fact[n],mod-2);
		for(int i=n-1;i>=0;i--) {
			invFact[i]=mul(invFact[i+1],i+1);
		}
	}
	long modInv(long x) {
		return power(x,mod-2);
	}

	long nCr(int n, int r) {
		if(n<r || r<0) return 0;
		return mul(fact[n],mul(invFact[r],invFact[n-r]));
	}

	long mul(long a, long b) {
		return a*b%mod;
	}
	long add(long a, long b) {
		return (a+b)%mod;
	}

	long power(long x, long y) {
		long gg=1;
		while(y>0) {
			if(y%2==1) gg=mul(gg,x);
			x=mul(x,x);
			y/=2;
		}
		return gg;
	}

    // Functions
	static long gcd(long a, long b) {
		return b==0?a:gcd(b,a%b);
	}
	static int gcd(int a, int b) {
		return b==0?a:gcd(b,a%b);
	}

	void print(int a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
		out.println();
	}

	void print(long a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
		out.println();
	}

    //Input Arrays
    static void input(long a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextLong();
		}
	}
	static void input(int a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextInt();
		}
	}
	static void input(String s[],int n) {
		for(int i=0;i<n;i++) {
			s[i]=inp.next();
		}
	}
	static void input(int a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextInt();
			}
		}
	}
	static void input(long a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextLong();
			}
		}
	}

}


import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		Scanner sc =   new Scanner(System.in);
		int a =sc.nextInt(), b=sc.nextInt() , c=sc.nextInt(),d=sc.nextInt();
	    if(a+b == c+d)
	        System.out.print("YES");
	    else
	     if(a+c == b+d)
	        System.out.print("YES");
	     else
	        if(a+d == b+c )
	            System.out.print("YES");
            else
               if(a == b+c+d)
                System.out.print("YES");
                else
                 if(b == a+c+d)
                    System.out.print("YES");
                    else
                        if(c== a+b+d)
                            System.out.print("YES");
                            else
                                if(d == a+b+c)
                                    System.out.print("YES");
                                    else
                                    System.out.print("NO");

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class A {

	static int[] genLucky()
	{
		int[] c = new int[1022];
		Queue<Integer> q = new LinkedList<Integer>();
		int k = 0;
		q.add(4); q.add(7);
		while(!q.isEmpty())
		{
			int x = c[k++] = q.remove();
			if(k == 1022)
				break;
			q.add(x * 10 + 4);
			q.add(x * 10 + 7);
		}
		return c;
	}

	static double prob(int x, int y, int l, int r)
	{
		if(x < l) x = l;
		if(y > r) y = r;
		if(x > y) return 0;
		return 1.0 * (y - x + 1) / (r - l + 1);
	}

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int pl = sc.nextInt(), pr = sc.nextInt(), vl = sc.nextInt(), vr = sc.nextInt(), k = sc.nextInt();
		int[] lucky = genLucky();
		double ans = 0;
		for(int i = 0; i + k <= 1022; ++i)
		{
			int xl = i == 0 ? 1 : lucky[i - 1] + 1;
			int xr = lucky[i];
			int yl = lucky[i + k - 1];
			int yr = i + k == 1022 ? (int)1e9 : lucky[i + k] - 1;
			ans += prob(xl, xr, pl, pr) * prob(yl, yr, vl, vr);
			ans += prob(yl, yr, pl, pr) * prob(xl, xr, vl, vr);
			if(k == 1)
				ans -= prob(xr, xr, pl, pr) * prob(xr, xr, vl, vr);
		}
		out.println(ans);
		out.close();
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		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();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;
public class template {
	public static void main(String[] args) throws Exception {
		new template().run();
	}
	public void run() throws Exception {
		FastScanner f = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		///
		int n = f.nextInt(), q = f.nextInt();
		int sz = 256;
		int[] arr = new int[n];
		int[][] orig = new int[(n-1)/sz+1][sz];
		int[] szs = new int[(n-1)/sz+1];
		int[][] val = new int[(n-1)/sz+1][sz];
		int[][][] id = new int[(n-1)/sz+1][][];
		Arrays.fill(val[val.length-1], -1);
		for(int i = 0; i < n; i++) {
			arr[i] = f.nextInt()-1;
			val[arr[i]/sz][szs[arr[i]/sz]] = arr[i];
			orig[arr[i]/sz][szs[arr[i]/sz]] = ++cnt;
			szs[arr[i]/sz]++;
		}
		for(int i = 0; i < sz; i++)
			if(val[val.length-1][i] == -1) val[val.length-1][i] = (val.length-1)*sz+i;
		add1 = new ArrayList<>(22000000); add2 = new ArrayList<>(2200000);
		aux = new int[9][2][][];
		aux2 = new int[9][4][];
		for(int i = 0; i <= 8; i++) {
			aux[i][0] = new int[(1 << i)+1][(1 << i)+1];
			aux[i][1] = new int[(1 << i)+1][(1 << i)+1];
			aux2[i][0] = new int[(1 << i)];
			aux2[i][1] = new int[(1 << i)];
			aux2[i][2] = new int[(1 << i)];
			aux2[i][3] = new int[(1 << i)];
		}
		for(int i = 0; i < id.length; i++) {
			id[i] = new int[sz+1][sz+1];
			aux2[8][0] = val[i];
			aux2[8][1] = orig[i];
			gen(i*sz, 8, 0);
			for(int a = 0; a <= sz; a++)
				for(int b = a+1; b <= sz; b++) id[i][a][b] = aux[8][0][a][b];
		}
		if(n % 256 != 0) for(int i = n-n/sz*sz; i < sz; i++) orig[orig.length-1][i] = 2147483647;
		int[] ans = new int[q];
		for(int i = 0; i < q; i++) {
			int l = f.nextInt(), r = f.nextInt()+1;
			for(int b = 0; b < orig.length; b++) {
				int s = 0, e = 0;
				{
					int lo = 0, hi = sz;
					while(lo < hi) {
						int m = (lo+hi)/2;
						if(orig[b][m] < l) lo = m+1;
						else hi = m;
					}
					s = lo;
				}
				{
					int lo = 0, hi = sz;
					while(lo < hi) {
						int m = (lo+hi)/2;
						if(orig[b][m] < r) lo = m+1;
						else hi = m;
					}
					e = lo;
				}
				ans[i] = add(ans[i], id[b][s][e]);
			}
		}
		out.println(cnt);
		for(int i = 0; i < add1.size(); i++) { out.println(add1.get(i) + " " + add2.get(i)); }
		for(int i : ans) out.print(i + " ");
		out.println();
///
		out.flush();
	}
	ArrayList<Integer> add1, add2;
	int cnt;
	int[][][][] aux;
	int[][][] aux2;
	public void gen(int st, int lvl1, int lvl2) {
		int n = 1 << lvl1;
		if(n == 1) {
			aux[lvl1][lvl2][0][1] = aux2[lvl1][2*lvl2+1][0];
			return;
		}
		int bb = 0, cc = 0;
		for(int i = 0; i < n; i++) {
			if(aux2[lvl1][2*lvl2][i] < st + n/2) {
				aux2[lvl1-1][0][bb] = aux2[lvl1][2*lvl2][i];
				aux2[lvl1-1][1][bb] = aux2[lvl1][2*lvl2+1][i];
				bb++;
			} else {
				aux2[lvl1-1][2][cc] = aux2[lvl1][2*lvl2][i];
				aux2[lvl1-1][3][cc] = aux2[lvl1][2*lvl2+1][i];
				cc++;
			}
		}
		gen(st, lvl1-1, 0);
		gen(st+n/2, lvl1-1, 1);
		int[][] u = aux[lvl1-1][0];
		int[][] v = aux[lvl1-1][1];
		int[][] res = aux[lvl1][lvl2];
		int bs = 0, cs = 0;
		for(int i = 0; i < n; i++) {
			int be = bs, ce = cs;
			for(int j = i; j < n; j++) {
				if(aux2[lvl1][2*lvl2][j] < st+n/2) be++;
				else ce++;
				res[i][j+1] = add(u[bs][be],v[cs][ce]);
			}
			if(aux2[lvl1][2*lvl2][i] < st+n/2) bs++;
			else cs++;
		}
	}
	public int add(int u, int v) {
		if(u*v == 0) return u+v;
		add1.add(u); add2.add(v);
		return ++cnt;
	}
///
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch(IOException e) {
				throw new RuntimeException(e);
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * Created by Derek on 2/10/2017.
 */
public class C489 {
    public static void main(String[] args) throws IOException{
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] input = stdin.readLine().split(" ");
        final int L = Integer.parseInt(input[0]);
        final int S = Integer.parseInt(input[1]);
        ArrayList<Integer> array = new ArrayList<>();
        array = findDigits(L, S, array);
        String min = "";
        String max = "";
        checkValid(L, S);
        for(int i:array){
            max+=i;
        }
        int size = array.size();
        if(size > L){
            System.out.println("-1 -1");
            System.exit(0);
        }
        if(size > 1 && array.get(size-1) == 0){
            array.set(size-1,1);
            for(int i = size-2; i >= 0; i--){
                if(array.get(i)>0){
                    array.set(i,array.get(i)-1);
                    break;
                }
            }
        }
        for(int x = array.size()-1; x >= 0; x--){
            min+=array.get(x);
        }
        System.out.println(min + " " + max);

    }
    public static void checkValid(int L, int S){
        if( (S == 0 && L > 1) || (L < (S/9+(S%9 > 0 ? 1:0))) ){
            System.out.println("-1 -1");
            System.exit(0);
        }
    }
    public static ArrayList<Integer> findDigits(int L , int S, ArrayList<Integer> array){
        if(L < 1){
            ArrayList<Integer> none = new ArrayList<>();
            none.add(-1);
            return(none);
        }
        else if(L == 1){
            array.add(S);
            return(array);
        }
        else if(S<10){
            for(int x = 9; x >= 0; x--){
                if(S-x >= 0 /*&& S-x >= ((L-1)/9+((L-1)%9 == 1 ? 1:0))*/){
                    array.add(x);
                    return(findDigits(L-1,S-x,array));
                }
            }
        }
        else{
            for(int x = 9; x >= 0; x--){
                if(S-x >= 0 /*&& S-x >= ((L-1)/9+((L-1)%9 == 1 ? 1:0))*/){
                    array.add(x);
                    return(findDigits(L-1,S-x,array));
                }
            }
        }
        return(array);
    }
}


// practice with rainboy
import java.io.*;
import java.util.*;

public class CF477A extends PrintWriter {
	CF477A() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF477A o = new CF477A(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	void main() {
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(((b * (b - 1) / 2) % MD) * ((b * (a * (a + 1) / 2 % MD) + a) % MD) % MD);
	}
}


import java.util.Scanner;

public class InsomniaCure {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dragons= new int[5];
        for(int i=0;i<5;i++)
            dragons[i] = sc.nextInt();
        boolean[] arr = new boolean[dragons[4]+1];
        for(int i=0;i<=dragons[4];i++)
            arr[i]=true;

        for(int i=0;i<dragons.length-1;i++){
            if(dragons[i]>dragons[4])
                break;
            if(arr[dragons[i]]== true){
                for(int j= dragons[i]; j<=dragons[4];j+=dragons[i])
                    arr[j]=false;
            }
        }
        int count=0;
        for(int i=1;i<=dragons[4];i++){
            if(arr[i]==false)
                count++;
            //System.out.println(arr[i]);
        }
        System.out.println(count);
        sc.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author shakhawat.hossain
 * @since 10/12/15.
 */
public class Schedule {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine().split(" ")[0]);

        String[] inputPairs = br.readLine().split(" ");

        int schoolPairCount = 0;

        int startIndex = 0;
        int lastIndex = inputPairs.length - 1;

        while (startIndex < inputPairs.length) {
            if (inputPairs[startIndex].equals("1")) {
                break;
            }

            startIndex++;
        }

        while (lastIndex >= 0) {
            if (inputPairs[lastIndex].equals("1")) {
                break;
            }

            lastIndex--;
        }

        for (int i = startIndex; i <= lastIndex; i++) {
            if (inputPairs[i].equals("1")) {
                schoolPairCount++;
            } else if (inputPairs[i].equals("0")) {

                if (i < lastIndex && inputPairs[i + 1].equals("0")) {
                    i++;
                    while (i < lastIndex) {
                        if (inputPairs[i+1].equals("1")) {
                            break;
                        }
                        i++;
                    }
                } else {
                    schoolPairCount++;
                }

            }
        }

        System.out.println(schoolPairCount);

    }
}


import java.util.*;
public class P721A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextLine();
		String[] B = sc.nextLine().split("W");
		ArrayList<Integer> nums = new ArrayList<Integer>();
		for (String s : B)
			if (s.length() > 0)
				nums.add(s.length());
		String ans = "";
		for (int i : nums)
			ans += " " + i;
		System.out.println(nums.size());
		if (nums.size() > 0)
			System.out.println(ans.substring(1));

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.text.DecimalFormat;
import java.util.Scanner;

public class justForFun {

	static Scanner sc=new Scanner(System.in);
	static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

	public static void main(String[] args) throws IOException {
		long x1,x2,y1,y2;
		x1=nextInt();
		y1=nextInt();
		x2=nextInt();
		y2=nextInt();
		long s=((x2-x1)/2+1)*((y2-y1)/2+1)+(x2-x1)*(y2-y1)/4;
		out.println(s);
		out.flush();
	}

	static String next() throws IOException{
		in.nextToken();
		return in.sval;
	}

	static int nextInt() throws IOException {
		in.nextToken();
		return (int) in.nval;
	}

	static double nextDouble() throws IOException {
		in.nextToken();
		return in.nval;
	}

	static long nextLong() throws IOException {
		in.nextToken();
		return (long) in.nval;
	}

}


import java.util.ArrayList;
import java.util.Scanner;

public class CF8E {
  static long[] rev;
  static long[] inv;
  static long[] two;

  private static void init(int n) {
    rev = new long[n + 1];
    inv = new long[n + 1];
    two = new long[n + 1];
    rev[0] = 1;
    rev[1] = 2;
    inv[0] = 1;
    inv[1] = 1;
    two[0] = 1;
    two[1] = 2;
    for (int i = 2; i <= n; i++) {
      two[i] = two[i - 1] * 2;
      rev[i] = rev[i - 2] * 2 + two[i - 2];
      inv[i] = inv[i - 2] * 2 + two[i - 2];
    }
  }

  private static long[] toNumber(ArrayList<Integer> prefix, int n) {
    int l = Math.min(prefix.size(), n - prefix.size());
    Integer[] list = new Integer[l];
    prefix.toArray(list);
    long[] res = new long[2];
    for (int i = 0; i < l; i++) {
      res[0] *= 2;
      res[0] += prefix.get(i);
      res[1] *= 2;
      res[1] += (1 - prefix.get(i));
    }
    return res;
  }

  private static int check(ArrayList<Integer> prefix, int l) {
    int res = 0;
    int i;
    for (i = l; i < prefix.size(); i++) {
      if (prefix.get(i) < prefix.get(prefix.size() - 1 - i + l)) {
        res++;
        break;
      } else if (prefix.get(i) > prefix.get(prefix.size() - 1 - i + l)) {
        break;
      }
    }
    if (i >= prefix.size()) {
      res++;
    }
    for (i = l; i < prefix.size(); i++) {
      if (prefix.get(i) < 1 - prefix.get(prefix.size() - 1 - i + l)) {
        res++;
        break;
      } else if (prefix.get(i) > 1 - prefix.get(prefix.size() - 1 - i + l)) {
        break;
      }
    }
    if (i >= prefix.size()) {
      res++;
    }
    return res;
  }

  private static long calc(ArrayList<Integer> prefix, int n) {
    int halfLen = n / 2;
    long[] num = toNumber(prefix, n);
    if (prefix.size() <= halfLen) {
      return (num[1] - num[0] - 1) * two[n - 2 * prefix.size()] + rev[n - 2 * prefix.size()]
          + inv[n - 2 * prefix.size()];
    } else {
      int l = n - prefix.size();
      return num[1] - num[0] - 1 + check(prefix, l);
    }
  }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long k = sc.nextLong();
    sc.close();
    init(n);
    ArrayList<Integer> res = new ArrayList<>();
    for (int i = 0; i < n; i++) {
      res.add(0);
      long p = calc(res, n);
      if (p <= k && i == 0) {
        break;
      } else if (p <= k) {
        res.set(i, 1);
        k -= p;
      }
    }
    if (res.size() < n) {
      System.out.println(-1);
    } else {
      for (int i = 0; i < n; i++) {
        System.out.print(res.get(i));
      }
    }
  }
}


import java.util.*;

    public class Test {
    	static int f = 1;
            public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
            	long l = input.nextLong();
            	long r = input.nextLong();

            		System.out.println(lucky(l,r));
            }

            public static long lucky(long l,long r){
            	long sum = 0;
            	for(long i = l ; i <= r ; i++){
            		long sk = numer(f,i);
            		//long sk2 = numer(f+1,i);
            		if(i <= 4){
            			if(r <= 4){
            				sum += (r-i+1)*4;
            				return sum;
            			}else{
            				sum += (4-i+1)*4;
            			}
            			i = 4;
            		}else if(sk > r){
            			sum += sk*(r-i+1);
                		i = r;
            		}else{
            			sum += sk*(sk-i+1);
                		i = sk;
            		}
            	}
            	return sum;
            }

            public static long numer(int l,long k){
            	int sum = l;
            	boolean isnt = false;
            	while(sum < 100000){
            		String bin = numberToString(sum);
            		String snum = new String();
            		for(int i = 0 ; i < bin.length() ; i++){
            			if(bin.charAt(i) == '1'){
            				snum += "4";
            			}else if(bin.charAt(i) == '2'){
            				snum += "7";
            			}else{
            				isnt = true;
            				break;
            			}
            		}
            		if(isnt == false){
            			long snumber = Long.parseLong(snum);
                		if(k <= snumber){
                			f = sum;
                			return snumber;
                		}
            		}
            			sum++;
            			isnt  = false;
            	}
            	return -1;
            }

           public static String numberToString(long n){ return n==0 ? "" : numberToString(n/3) + (n%3);}
    }


import java.util.*;

public class cf78c {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		int k = in.nextInt();
		boolean winner = false;
		for(int i=1; i*i<=m; i++)
			if(m%i==0)
				if((i>=k && m/i>1) || (m/i>=k && i>1))
					winner = true;
		if(n%2==0) winner = false;
		System.out.println(winner?"Timur":"Marsel");
	}
}


import java.util.*;

public class Main {
	static int max(int x,int y) {
		return x<y?y:x;
	}
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n,k;
		n=in.nextInt();
		k=in.nextInt();

		String ss=in.next(),tt=in.next();

		char[] s=new char[300],t=tt.toCharArray();
		for(int i=0;i<n;++i)s[i+1]=ss.charAt(i);

		int[][][] dp=new int[300][300][300];
		for(int i=0;i<300;++i)
			for(int j=0;j<300;++j)
				Arrays.fill(dp[i][j], -10000000);
		dp[0][0][0]=0;
		for(int i=0;i<n;++i)
			for(int j=0;j<=k;++j)
				for(int cnt=0;cnt<=i;++cnt) {
					dp[i+1][j+1][cnt+1]=max(dp[i+1][j+1][cnt+1],dp[i][j][cnt]+(t[1]==t[0]?cnt:0));
					dp[i+1][j+1][cnt+(t[0]==t[1]?1:0)]=max(dp[i+1][j+1][cnt+(t[0]==t[1]?1:0)],dp[i][j][cnt]+cnt);
					dp[i+1][j][cnt+(s[i+1]==t[0]?1:0)]=max(dp[i+1][j][cnt+(s[i+1]==t[0]?1:0)],dp[i][j][cnt]+(s[i+1]==t[1]?cnt:0));
				}
		int ans=0;
		for(int i=0;i<=k;++i)
			for(int cnt=0;cnt<=n;++cnt)
				ans=max(ans,dp[n][i][cnt]);
		System.out.printf("%d",ans);
		in.close();
	}
}


import java.io.*;
import java.util.*;
public class SlimeCombiningLinear {
  private static InputReader in;
  private static PrintWriter out;
  public static double EPS = 1e-15;
  public static int maxp = 50;

  public static void main (String[] args) {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out, true);

    int n = in.nextInt();
    int p = in.nextInt();

    double p2 = p / 1000000000., p4 = 1 - p2;
    double[][] a = new double[maxp][maxp];
    double[][] b = new double[maxp][maxp];
    for (int len = 1; len < maxp; len++) {
      for (int pow = 1; pow < maxp; pow++) {
        if (pow == 1) a[len][pow] += p2;
        if (pow == 2) {
          a[len][pow] += p4;
          b[len][pow] += p4;
        }
        a[len][pow] += a[len-1][pow-1] * a[len][pow-1];
        b[len][pow] += a[len-1][pow-1] * b[len][pow-1];
      }
    }
    for (int len = maxp - 1; len >= 1; len--) {
      for (int pow = 1; pow < maxp; pow++) {
        a[len][pow] *= 1 - a[len-1][pow];
        b[len][pow] *= 1 - a[len-1][pow];
      }
    }

    // value of a slime that has been merged i times
    long[] vals = new long[maxp];
    for (int i = 0; i < maxp; i++) vals[i] = i;//1l << i;
    // manually do first few cases
    int maxn = 1000;
    double[][] dp = new double[maxn][maxp];
    double[][] sum = new double[maxn][maxp];
    for (int cur = 1; cur < maxp; cur++)
      dp[maxn-1][cur] = vals[cur];

    // manual dp
    for (int i = maxn-2; i >= 0; i--) {
      for (int cur = 1; cur < maxp; cur++) {
        for (int next = 1; next < maxp; next++) {
          if (cur == next) continue;
          if (cur == 1) {
            int id = Math.min(maxp-1, maxn-i-1);
            dp[i][cur] += b[id][next] * dp[i+1][next];
            sum[i][cur] += b[id][next];
          } else {
            if (cur < next) continue;
            int id = Math.min(maxp-1, maxn-i-1);
            dp[i][cur] += a[id][next] * dp[i+1][next];
            sum[i][cur] += a[id][next];
          }
        }
      }
      for (int cur = 1; cur < maxp; cur++) {
        dp[i][cur] = vals[cur] + dp[i][cur] / sum[i][cur];
      }
    }
    if (n <= maxn) {
      int k = (int)n;
      int w = Math.min(maxp-1, k);
      double exp = 0;
      for (int i = 1; i < maxp; i++) {
        exp += a[w][i] * dp[maxn-k][i];
      }
      out.printf("%.15f\n", exp);
      out.close();
      System.exit(0);
    }

    double exp1 = 0;
    double exp2 = 0;
    for (int i = 1; i < maxp; i++) {
      exp1 += a[maxp-1][i] * dp[0][i];
      exp2 += a[maxp-1][i] * dp[1][i];
    }
    out.printf("%.15f\n", exp2 + (exp1 - exp2) * (long)(n - maxn + 1));
    out.close();
    System.exit(0);
  }
  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}


import java.awt.Point;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Contest {
	private static PrintWriter out = new PrintWriter(System.out);

	private static String helper(long n, char s) {
		StringBuilder str = new StringBuilder("");
		for (int i = 0; i < n; i++) {
			str.append(s);
		}
		return str.toString();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

			long k = sc.nextLong();
			String str = "codeforces";
			long[] v = new long[10];

			for(int i = 0;true;i++) {
				int j = i % 10;
				v[j]++;
				long count = 1;
				for(long x : v) {
					count *= x;
				}
				if(count >= k)
					break;
			}

			for (int i = 0; i < v.length; i++) {
				out.print(helper(v[i], str.charAt(i)));
			}

			out.flush();

	}

	private static long sum(ArrayList<Long> r) {
		long s = 0;
		for (int i = 0; i < Math.min(10, r.size()); i++) {
			s += r.get(r.size() - 1 - i);
		}
		// System.out.println("s: " + s);
		long p = 1;
		for (int i = 9; i < r.size(); i++)
			p *= r.get(r.size() - 1 - i);
		if (r.size() > 10)
			return s - r.get(r.size() - 9 - 1) + p;

		return s;
	}

	private static ArrayList<Long> factors(long k) {
		ArrayList<Long> res = new ArrayList<>();

		for (long i = 2; i * i <= k; i++) {
			while (k % i == 0) {
				res.add(i);
				k /= i;
			}
		}
		if (k > 1)
			res.add(k);
		return res;
	}

	private static class Scanner {
		public BufferedReader reader;
		public StringTokenizer st;

		public Scanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			st = null;
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					String line = reader.readLine();
					if (line == null)
						return null;
					st = new StringTokenizer(line);
				} catch (Exception e) {
					throw (new RuntimeException());
				}
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}

}


import java.util.Scanner;
import java.util.Stack;

public class Code_For_1 {

	public static long findOnes(long num, long left, long right, long l, long r)
	{
		if(l>right || r<left || num==0)
		{
			return 0;
		}

		if(num==1)
		{
			return 1;
		}

		long mid=left+countDigit(num/2);
		long ones=findOnes(num/2,mid+1,right,l,r)+findOnes(num%2,mid,mid,l,r)+findOnes(num/2,left,mid-1,l,r);

		return ones;

	}

	public static long countDigit(long num)
	{
		if(num<=1)
		{
			return num;
		}

		long digit=countDigit(num/2)*2+1;
		return digit;
	}

	/*public static void populate(Stack<Integer> series, long num)
	{
		if(num<2)
		{
			series.push((int) num);
			return;
		}

		populate(series,num/2);
		series.push((int) (num%2));
		populate(series,num/2);
	}*/

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		long num=in.nextLong();
		long l=in.nextLong();
		long r=in.nextLong();

		/*Stack<Integer> series=new Stack<>();

		populate(series,num);

		int count=0;

		for(int i=(int) (l-1);i<r;i++)
		{
			if(series.get(i)==1)
			{
				count++;
			}
		}

		System.out.println(count);
		*/

		long right=countDigit(num);
		long left=1;
		long result=findOnes(num,left,right,l,r);

		System.out.println(result);

	}

}