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();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    }
} 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();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    } 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 int index = -1; index -1 1 for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        } {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        } if (S.charAt(i) != '1') {
                index = i;
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                index = i;
                break;
            } index = i index i break; if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        } index == -1 index -1 1 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        } if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            } index > K - 1 index K - 1 K 1 {
                System.out.println(1);
            } System.out.println(1) System.out.println System.out System System.out 1 {
                System.out.println(String.valueOf(S.charAt(index)));
            } System.out.println(String.valueOf(S.charAt(index))) System.out.println System.out System System.out String.valueOf(S.charAt(index)) String.valueOf String S.charAt(index) S.charAt S index sc.close() sc.close sc 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();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    }
} 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();
        int index = -1;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != '1') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            System.out.println(1);
        } else {
            if (index > K - 1) {
                System.out.println(1);
            } else {
                System.out.println(String.valueOf(S.charAt(index)));
            }
        }
        sc.close();
    }
}