import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

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

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    } main {
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String a = scan.next(); a scan.next() scan.next scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan int po = 0; po 0 for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        } int i=0; int i=0; i 0 i<a.length() i a.length() a.length a i++ i++ i {
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        } {
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        } if (a.charAt(i) != '1'){
                po = i;
                break;
            } a.charAt(i) != '1' a.charAt(i) a.charAt a i '1' {
                po = i;
                break;
            } po = i po i break; if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        } k < po+1 k po+1 po 1 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(a.charAt(po));
        } System.out.println(a.charAt(po)) System.out.println System.out System System.out a.charAt(po) a.charAt a po return; String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long k = scan.nextLong();
        int po = 0;
        for (int i=0;i<a.length();i++){
            if (a.charAt(i) != '1'){
                po = i;
                break;
            }
        }

        if (k < po+1){
            System.out.println(1);
        }
        else{
            System.out.println(a.charAt(po));
        }
        return;
        
    }
}