import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} import java.util.*; util.* java import java.math.*; math.* java class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} Main public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    } main {
        
        try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    } try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        } catch(Exception e){
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc long k = Long.parseLong(sc.next()); k Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc int loopOne = 0; loopOne 0 String notOne = ""; notOne "" for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            } {
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            } String subS = s.substring(i, i + 1); subS s.substring(i, i + 1) s.substring s i i + 1 i 1 if(!subS.equals("1")){
                    notOne = subS;
                    break;
                } !subS.equals("1") subS.equals("1") subS.equals subS "1" {
                    notOne = subS;
                    break;
                } notOne = subS notOne subS break; loopOne++ loopOne if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne); k <= loopOne k loopOne System.out.println(1) System.out.println System.out System System.out 1 System.out.println(notOne) System.out.println System.out System System.out notOne String[] args args
import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            String s = sc.next();
            long k = Long.parseLong(sc.next());

            int loopOne = 0;
            String notOne = "";

            for(int i = 0; i < s.length(); i++){
                String subS = s.substring(i, i + 1);
                if(!subS.equals("1")){
                    notOne = subS;
                    break;
                }
                loopOne++;
            }

            if(k <= loopOne) System.out.println(1);
            else System.out.println(notOne);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}