import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    } main {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    } 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 if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        } K==1 K 1 {
            System.out.println(s.charAt(0));
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 {
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        } int i=0; i 0 while(i<K&&s.charAt(i)=='1'){
                i++;
            } i<K&&s.charAt(i)=='1' i<K i K s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' {
                i++;
            } i++ i if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            } i==K i K {
                System.out.println(s.charAt((int)(K-1)));
            } System.out.println(s.charAt((int)(K-1))) System.out.println System.out System System.out s.charAt((int)(K-1)) s.charAt s (int)(K-1) K 1 {
                System.out.println(s.charAt(i));
            } System.out.println(s.charAt(i)) System.out.println System.out System System.out s.charAt(i) s.charAt s i String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long K=sc.nextLong();
        if(K==1){
            System.out.println(s.charAt(0));
        }else{
            int i=0;
            while(i<K&&s.charAt(i)=='1'){
                i++;
            }
            if(i==K){
                System.out.println(s.charAt((int)(K-1)));
            }else{
                System.out.println(s.charAt(i));
            }
        }
    }
}
