import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc char[] c = str.toCharArray(); c str.toCharArray() str.toCharArray str long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc int n = str.length(); n str.length() str.length str for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        } {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        } if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            } c[i] == '1' c[i] c i '1' {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } if (i == k - 1) {
                    System.out.println(1);
                    return;
                } i == k - 1 i k - 1 k 1 {
                    System.out.println(1);
                    return;
                } System.out.println(1) System.out.println System.out System System.out 1 return; {
                System.out.println(c[i]);
                return;
            } System.out.println(c[i]) System.out.println System.out System System.out c[i] c i return; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] c = str.toCharArray();
        long k = sc.nextLong();
        int n = str.length();
        
        for (int i = 0; i < k; i++) {
            if (c[i] == '1') {
                if (i == k - 1) {
                    System.out.println(1);
                    return;
                }
            } else {
                System.out.println(c[i]);
                return;
            }
        }
    }
}
