
import java.util.*;

public class Main {
    static String S;
    static long K;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    }
    public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    }

    public static void put(Object object){
        System.out.println(object);
    }
    public static String format(String string,Object... args){
        return String.format(string,args);
    }

    public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
} import java.util.*; util.* java public class Main {
    static String S;
    static long K;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    }
    public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    }

    public static void put(Object object){
        System.out.println(object);
    }
    public static String format(String string,Object... args){
        return String.format(string,args);
    }

    public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
} Main static String S; S static long K; K public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    } main {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) S=scanner.next() S scanner.next() scanner.next scanner K=scanner.nextLong() K scanner.nextLong() scanner.nextLong scanner solve() solve String[] args args public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    } solve {
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    } int first1Lnegth=0; first1Lnegth 0 char nextChar=0; nextChar 0 for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                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'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        } {
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        } if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            } S.charAt(i)=='1' S.charAt(i) S.charAt S i '1' {
                first1Lnegth++;
            } first1Lnegth++ first1Lnegth {
                nextChar=S.charAt(i);
                break;
            } nextChar=S.charAt(i) nextChar S.charAt(i) S.charAt S i break; if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        } K<=first1Lnegth K first1Lnegth {
            put(1);
        } put(1) put 1 {
            put(nextChar);
        } put(nextChar) put nextChar public static void put(Object object){
        System.out.println(object);
    } put {
        System.out.println(object);
    } System.out.println(object) System.out.println System.out System System.out object Object object object public static String format(String string,Object... args){
        return String.format(string,args);
    } format {
        return String.format(string,args);
    } return String.format(string,args); String.format(string,args) String.format String string args String string string Object... args args public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    } Pair final public int x x y; y Pair(int x,int y){
            this.x=x;
            this.y=y;
        } Pair {
            this.x=x;
            this.y=y;
        } this.x=x this.x this this.x x this.y=y this.y this this.y y int x x int y y public class Main {
    static String S;
    static long K;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    }
    public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    }

    public static void put(Object object){
        System.out.println(object);
    }
    public static String format(String string,Object... args){
        return String.format(string,args);
    }

    public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
} public class Main {
    static String S;
    static long K;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    }
    public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    }

    public static void put(Object object){
        System.out.println(object);
    }
    public static String format(String string,Object... args){
        return String.format(string,args);
    }

    public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
} Main

import java.util.*;

public class Main {
    static String S;
    static long K;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        S=scanner.next();
        K=scanner.nextLong();
        solve();
    }
    public static void solve(){
        int first1Lnegth=0;
        char nextChar=0;
        for(int i=0;i<S.length();i++){
            if(S.charAt(i)=='1'){
                first1Lnegth++;
            }else{
                nextChar=S.charAt(i);
                break;
            }
        }
        if(K<=first1Lnegth){
            put(1);
        }else{
            put(nextChar);
        }
    }

    public static void put(Object object){
        System.out.println(object);
    }
    public static String format(String string,Object... args){
        return String.format(string,args);
    }

    public static class Pair{
        final public int x,y;
        Pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
}
