import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner long k = scanner.nextLong(); k scanner.nextLong() scanner.nextLong scanner for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		} char c s.toCharArray() s.toCharArray s {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		} {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		} if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--; k==1 k 1 {
				System.out.println(c);
				break;
			} System.out.println(c) System.out.println System.out System System.out c break; if (c!='1'){
				System.out.println(c);
				break;
			}else k--; c!='1' c '1' {
				System.out.println(c);
				break;
			} System.out.println(c) System.out.println System.out System System.out c break; k-- k String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		long k = scanner.nextLong();
		for (char c: s.toCharArray()) {
			if (k==1) {
				System.out.println(c);
				break;
			}else if (c!='1'){
				System.out.println(c);
				break;
			}else k--;
		}
	}
}