import java.util.*;

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

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