import java.util.Scanner;

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

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		char c = '.';
		for(int i = 0; i < S.length(); i++) {
			if(i == K - 1) {
				c = S.charAt(i);
				break;
			}else if(S.charAt(i) != '1') {
				c = S.charAt(i);
				break;
			}
		}
		System.out.println(c);
	}
}