import java.util.Scanner;

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

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