import java.util.Scanner;

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

		String S = sc.next();
		long K = sc.nextLong();

		long cnt = 1;
		for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		}
		System.out.println(1);
	}
} import java.util.Scanner; Scanner 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();

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

		String S = sc.next();
		long K = sc.nextLong();

		long cnt = 1;
		for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		}
		System.out.println(1);
	} main {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		long K = sc.nextLong();

		long cnt = 1;
		for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		}
		System.out.println(1);
	} 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 long cnt = 1; cnt 1 for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		} 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') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		} {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		} char c = S.charAt(i); c S.charAt(i) S.charAt S i if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			} c != '1' c '1' {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			} if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				} K < cnt K cnt {
					System.out.println(1);
				} System.out.println(1) System.out.println System.out System System.out 1 {
					System.out.println(c);
				} System.out.println(c) System.out.println System.out System System.out c return; cnt++ cnt System.out.println(1) System.out.println System.out System System.out 1 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();

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

		String S = sc.next();
		long K = sc.nextLong();

		long cnt = 1;
		for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		}
		System.out.println(1);
	}
} Main
import java.util.Scanner;

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

		String S = sc.next();
		long K = sc.nextLong();

		long cnt = 1;
		for (int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if (c != '1') {
				if (K < cnt) {
					System.out.println(1);
				}else {
					System.out.println(c);
				}
				return;
			}
			cnt++;
		}
		System.out.println(1);
	}
}
