import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    }
} import java.util.*; util.* java public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    } main {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    } char[] chars = sc.next().toCharArray(); chars sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        } int i = 0; int i = 0; i 0 i < Math.min(chars.length, K) i Math.min(chars.length, K) Math.min Math chars.length chars chars.length K i++ i++ i {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        } {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        } if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            } chars[i] != '1' chars[i] chars i '1' {
                System.out.println(chars[i]);
                return;
            } System.out.println(chars[i]) System.out.println System.out System System.out chars[i] chars i return; System.out.println('1') System.out.println System.out System System.out '1' String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    }
} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    }
} Main
import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        char[] chars = sc.next().toCharArray();
        long K = sc.nextLong();

        for (int i = 0; i < Math.min(chars.length, K); i++) {
            if (chars[i] != '1') {
                System.out.println(chars[i]);
                return;
            }
        }
        System.out.println('1');
    }
}
