import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    } main {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String S = sc.next(); S sc.next() sc.next sc final long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc char c = 1; c 1 int index = S.length(); index S.length() S.length S for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        } {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        } if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                c = S.charAt(i);
                index = i;
                break;
            } c = S.charAt(i) c S.charAt(i) S.charAt S i index = i index i break; if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        } K <= index K index {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(c);
        } System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    }
} public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final long K = sc.nextLong();


        char c = 1;
        int index = S.length();
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                c = S.charAt(i);
                index = i;
                break;
            }
        }

        if (K <= index) {
            System.out.println(1);
        } else {
            System.out.println(c);
        }
    }
}
