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