import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    } main {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan long K = Long.parseLong(scan.next()); K Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan long count = 0; count 0 for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        } 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') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        } {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        } if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            } if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                } K < i + 1 K i + 1 i 1 {
                    System.out.println(1);
                    return;
                } System.out.println(1) System.out.println System.out System System.out 1 return; {
                    System.out.println(S.charAt(i));
                    return;
                } System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i return; System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = Long.parseLong(scan.next());

        long count = 0;

        for(int i =0;i<S.length();i++) {

            if (S.charAt(i) != '1') {

                if (K < i + 1) {
                    System.out.println(1);
                    return;
                } else {
                    System.out.println(S.charAt(i));
                    return;
                }
            }
        }


        System.out.println(1);
    }
}