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

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

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

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

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    } Scanner sc = new Scanner(System.in); sc 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 char c[] = s.toCharArray(); c s.toCharArray() s.toCharArray s char cs = '1'; cs '1' for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        } {
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        } if(c[i] != '1'){
                cs = c[i];
                break;
            } c[i] != '1' c[i] c i '1' {
                cs = c[i];
                break;
            } cs = c[i] cs c[i] c i break; System.out.println(cs) System.out.println System.out System System.out cs sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

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

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    }
} Main
import java.util.*;
import java.io.*;

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

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = '1';

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    }
}