import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc int ans = 0; ans 0 int n = 0; n 0 for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        } {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        } n = s.charAt(i) - '0' n s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' k-- k if (k == 0 || n > 1) break; k == 0 || n > 1 k == 0 k 0 n > 1 n 1 break; System.out.println(n) System.out.println System.out System System.out n 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.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long k = sc.nextLong();
        int ans = 0;
        int n = 0;
        for (int i = 0; i < s.length(); i++) {
            n = s.charAt(i) - '0';
            k--;
            if (k == 0 || n > 1) break;
        }
        System.out.println(n);
        sc.close();
    }
}
