import java.io.*;
import java.util.*;

public class Main {

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

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

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

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) char[] ch = sc.next().toCharArray(); ch sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc final int N = ch.length; N ch.length ch ch.length final long K = Long.parseLong(sc.next()); K Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc char ans = '1'; ans '1' for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        } {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        } if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            } ch[i] != '1' && i < K ch[i] != '1' ch[i] ch i '1' i < K i K {
                ans = ch[i];
                break;
            } ans = ch[i] ans ch[i] ch i break; out.println(ans) out.println out ans out.flush() out.flush out String[] args args public class Main {

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

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    }
} public class Main {

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

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

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

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        final long K = Long.parseLong(sc.next());
        char ans = '1';
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != '1' && i < K) {
                ans = ch[i];
                break;
            }
        }

        out.println(ans);
        
        out.flush();
    }
}