import java.util.Scanner;

public class Main {

	/** 1の文字 */
	private static final char ONE = '1';

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

	/** 1の文字 */
	private static final char ONE = '1';

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		}
	}
} Main /** 1の文字 */
	private static final char ONE = '1'; ONE '1' public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		} {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) char[] s = scanner.next().toCharArray(); s scanner.next().toCharArray() scanner.next().toCharArray scanner.next() scanner.next scanner long k = scanner.nextLong(); k scanner.nextLong() scanner.nextLong scanner for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			} char c s {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			} {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			} if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				} ONE == c ONE c {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} k-- k if (0L == k) {
						System.out.println(c);
						return;
					} 0L == k 0L k {
						System.out.println(c);
						return;
					} System.out.println(c) System.out.println System.out System System.out c return; {
					System.out.println(c);
					return;
				} System.out.println(c) System.out.println System.out System System.out c return; String[] args args public class Main {

	/** 1の文字 */
	private static final char ONE = '1';

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

	/** 1の文字 */
	private static final char ONE = '1';

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	/** 1の文字 */
	private static final char ONE = '1';

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			long k = scanner.nextLong();
			for (char c : s) {
				if (ONE == c) {
					k--;
					if (0L == k) {
						System.out.println(c);
						return;
					}
				} else {
					System.out.println(c);
					return;
				}
			}
		}
	}
}
