import java.util.Arrays;
import java.util.Scanner;

class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String str = sc.next();
        long k = sc.nextLong();

        for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String str = sc.next();
        long k = sc.nextLong();

        for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        }
    }
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        String str = sc.next();
        long k = sc.nextLong();

        for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        }
    } main {
        String str = sc.next();
        long k = sc.nextLong();

        for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        }
    } String str = sc.next(); str sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        } {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        } if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            } i == k-1 i k-1 k 1 {
                System.out.println(str.charAt(i));
                return;
            } System.out.println(str.charAt(i)) System.out.println System.out System System.out str.charAt(i) str.charAt str i return; if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            } str.charAt(i) != '1' str.charAt(i) str.charAt str i '1' {
                System.out.println(str.charAt(i));
                return;
            } System.out.println(str.charAt(i)) System.out.println System.out System System.out str.charAt(i) str.charAt str i return; String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String str = sc.next();
        long k = sc.nextLong();

        for (int i = 0; i < str.length(); i++) {
            if (i == k-1) {
                System.out.println(str.charAt(i));
                return;
            }
            if (str.charAt(i) != '1') {
                System.out.println(str.charAt(i));
                return;
            }
        }
    }
}