import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                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.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        }
        System.out.println(1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        }
        System.out.println(1);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        }
        System.out.println(1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc int maxLength = (int) Math.min(S.length(), K); maxLength (int) Math.min(S.length(), K) Math.min Math S.length() S.length S K for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        } int i = 0; int i = 0; i 0 i < maxLength i maxLength i++ i++ i {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        } {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        } if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                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 sc = new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        }
        System.out.println(1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                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.nextLine();
        long K = sc.nextLong();

        int maxLength = (int) Math.min(S.length(), K);
        for (int i = 0; i < maxLength; i++) {
            if (S.charAt(i) != '1') {
                System.out.println(S.charAt(i));
                return;
            }
        }
        System.out.println(1);
    }
}
