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

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

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

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if ('1' == c) {
                continue;
            }
            if (k < i + 1) {
                System.out.println(1);
            } else {
                System.out.println(c);
            }
            return;
        }
        System.out.println(1);
    }

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

}
