
import java.util.Scanner;



public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	} main {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

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

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	}
} Main

import java.util.Scanner;



public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		char[] S = sc.next().toCharArray();
		long K = sc.nextLong();


		for (int i = 0; i < S.length; i++) {
			if (S[i] != '1') {
				System.out.println(S[i]);
				break;
			}else {
				if (i == K - 1) {
					System.out.println(S[i]);
					break;
				}
			}
		}

	}
}
