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();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    }    
} 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();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    }    
} Main public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long k=sc.nextLong();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    } main {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long k=sc.nextLong();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    } 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(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        } s.length()>1 s.length() s.length s 1 {
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        } if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            } s.charAt(0)=='1' s.charAt(0) s.charAt s 0 '1' {
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            } int count=0; count 0 for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                } 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'){
                        break;
                    }
                    else{
                        count++;
                    }
                } {
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                } if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    } s.charAt(i)!='1' s.charAt(i) s.charAt s i '1' {
                        break;
                    } break; {
                        count++;
                    } count++ count if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                } k>count k count {
                    System.out.println(s.charAt(count));
                } System.out.println(s.charAt(count)) System.out.println System.out System System.out s.charAt(count) s.charAt s count {
                    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 {
                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 {
            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 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();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    }    
} public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        long k=sc.nextLong();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    }    
} 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();
        if(s.length()>1){
            if(s.charAt(0)=='1'){
                int count=0;
                for(int i=0;i<s.length();i++){
                    if(s.charAt(i)!='1'){
                        break;
                    }
                    else{
                        count++;
                    }
                }
                //System.out.println("count="+count);
                if(k>count){
                    System.out.println(s.charAt(count));
                }
                else{
                    System.out.println(s.charAt(0));
                }
            }
            else{
                System.out.println(s.charAt(0));
            }
        }
        else{
            System.out.println(s.charAt(0));
        }
    }    
}