import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc sc.close() sc.close sc int numHeadingOne = 0; numHeadingOne 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                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') {
                numHeadingOne++;
            } else {
                break;
            }
        } {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        } if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                numHeadingOne++;
            } numHeadingOne++ numHeadingOne {
                break;
            } break; if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        } k <= numHeadingOne k numHeadingOne {
            System.out.println('1');
        } System.out.println('1') System.out.println System.out System System.out '1' {
            System.out.println(s.charAt(numHeadingOne));
        } System.out.println(s.charAt(numHeadingOne)) System.out.println System.out System System.out s.charAt(numHeadingOne) s.charAt s numHeadingOne String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        sc.close();

        int numHeadingOne = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') {
                numHeadingOne++;
            } else {
                break;
            }
        }
//        System.out.println(numHeadingOne);

        if (k <= numHeadingOne) {
            System.out.println('1');
        } else {
            System.out.println(s.charAt(numHeadingOne));
        }

    }
}
