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

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    }
} 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();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = sc.nextLong();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = sc.nextLong();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    } 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 if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        } k == 1 k 1 {
            System.out.println(s.charAt(0));
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        } char ans = 0; ans 0 for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            } {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            } if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                } s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' {
                    ans = s.charAt(i);
                    break;
                } ans = s.charAt(i) ans s.charAt(i) s.charAt s i break; if (ans == 0)
                ans = '1'; ans == 0 ans 0 ans = '1' ans '1' System.out.println(ans) System.out.println System.out System System.out ans 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();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = sc.nextLong();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    }
} 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();

        if (k == 1) {
            System.out.println(s.charAt(0));
        } else {
            char ans = 0;
            for (int i = 0; i < k; i++) {
                if (s.charAt(i) != '1') {
                    ans = s.charAt(i);
                    break;
                }
            }
            if (ans == 0)
                ans = '1';
            System.out.println(ans);
        }
    }
}
