import 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();
        sc.close();
        int pos = 0;
        while(pos < S.length()){
            if(S.charAt(pos) != '1'){
                if(K > pos)
                    System.out.println(S.charAt(pos));
                else
                    System.out.println(1);
                break;
            } else
                pos++;
            if(pos == S.length()){
                System.out.println(1);
            }
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in); 

        String S = sc.next();
        long K = sc.nextLong();
        sc.close();
        int pos = 0;
        while(pos < S.length()){
            if(S.charAt(pos) != '1'){
                if(K > pos)
                    System.out.println(S.charAt(pos));
                else
                    System.out.println(1);
                break;
            } else
                pos++;
            if(pos == S.length()){
                System.out.println(1);
            }
        }
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in); 

        String S = sc.next();
        long K = sc.nextLong();
        sc.close();
        int pos = 0;
        while(pos < S.length()){
            if(S.charAt(pos) != '1'){
                if(K > pos)
                    System.out.println(S.charAt(pos));
                else
                    System.out.println(1);
                break;
            } else
                pos++;
            if(pos == S.length()){
                System.out.println(1);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in); 

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

        String S = sc.next();
        long K = sc.nextLong();
        sc.close();
        int pos = 0;
        while(pos < S.length()){
            if(S.charAt(pos) != '1'){
                if(K > pos)
                    System.out.println(S.charAt(pos));
                else
                    System.out.println(1);
                break;
            } else
                pos++;
            if(pos == S.length()){
                System.out.println(1);
            }
        }
    }
} Main
import 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();
        sc.close();
        int pos = 0;
        while(pos < S.length()){
            if(S.charAt(pos) != '1'){
                if(K > pos)
                    System.out.println(S.charAt(pos));
                else
                    System.out.println(1);
                break;
            } else
                pos++;
            if(pos == S.length()){
                System.out.println(1);
            }
        }
    }
}