import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    }
} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    } main {
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String input = scan.next(); input scan.next() scan.next scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        } k == 1 k 1 {
            System.out.println(input.charAt(0));
        } System.out.println(input.charAt(0)) System.out.println System.out System System.out input.charAt(0) input.charAt input 0 {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        } for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            } int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            } {
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            } if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                } input.charAt(i) == '1' && i == k - 1 input.charAt(i) == '1' input.charAt(i) input.charAt input i '1' i == k - 1 i k - 1 k 1 {
                    System.out.println(1);
                    break;
                } System.out.println(1) System.out.println System.out System System.out 1 break; if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                } input.charAt(i) != '1' input.charAt(i) input.charAt input i '1' {
                    System.out.println(input.charAt(i));
                    break;
                } System.out.println(input.charAt(i)) System.out.println System.out System System.out input.charAt(i) input.charAt input i break; String[] args args public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    }
} public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    }
} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        String input = scan.next();
        long k = scan.nextLong();

        if(k == 1){
            System.out.println(input.charAt(0));
        } else {
            for(int i = 0; i < 100; i++){
                if(input.charAt(i) == '1' && i == k - 1){
                    System.out.println(1);
                    break;
                } else if(input.charAt(i) != '1'){
                    System.out.println(input.charAt(i));
                    break;
                }
            }
        }


    }
}