import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        }
    } 
} import java.util.*; util.* java import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList 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();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                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();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                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 int l = S.length(); l S.length() S.length S for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        } int i=0; int i=0; i 0 i<l i l i++ i++ i {
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        } {
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        } if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            } !S.substring(i,i+1).equals("1") S.substring(i,i+1).equals("1") S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 "1" {
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            } if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                } i<K i K {
                    System.out.println(S.substring(i, i+1));
                    break;
                } System.out.println(S.substring(i, i+1)) System.out.println System.out System System.out S.substring(i, i+1) S.substring S i i+1 i 1 break; if(i==l-1){
                System.out.println(1);
            } i==l-1 i l-1 l 1 {
                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();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                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();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        }
    } 
} Main
import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();
        int l = S.length();

        for(int i=0; i<l; i++){
            if(!S.substring(i,i+1).equals("1")){
                if(i<K){
                    System.out.println(S.substring(i, i+1));
                    break;
                }
            }
            if(i==l-1){
                System.out.println(1);
            }
        }
    } 
}