import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	} main {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		} n <= s.length() n s.length() s.length s {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		} for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			} {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			} if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				} s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
					continue;
				} continue; {
					System.out.println(s.charAt(i));
					return;
				} System.out.println(s.charAt(i)) System.out.println System.out System System.out s.charAt(i) s.charAt s i return; System.out.println(1) System.out.println System.out System System.out 1 return; for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		} {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		} if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			} s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
				continue;
			} continue; {
				System.out.println(s.charAt(i));
				return;
			} System.out.println(s.charAt(i)) System.out.println System.out System System.out s.charAt(i) s.charAt s i return; System.out.println(1) System.out.println System.out System System.out 1 String args[] args public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	}
} Main
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		long n = scanner.nextLong();

		if (n <= s.length()) {
			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == '1') {
					continue;
				} else {
					System.out.println(s.charAt(i));
					return;
				}
			}

			System.out.println(1);
			return;
		}
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				continue;
			} else {
				System.out.println(s.charAt(i));
				return;
			}
		}

		System.out.println(1);
	}
}
