import java.util.Scanner;

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

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static long K;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		K = sc.nextLong();

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	}
} Main static long K; K public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		K = sc.nextLong();

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		K = sc.nextLong();

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc K = sc.nextLong() K sc.nextLong() sc.nextLong sc String s = String.valueOf(S); s String.valueOf(S) String.valueOf String S String[] sarray = s.split(""); sarray s.split("") s.split s "" String ans = "1"; ans "1" for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		} {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		} if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			} !sarray[i].equals("1") sarray[i].equals("1") sarray[i].equals sarray[i] sarray i "1" {
				ans = (sarray[i]);
				break;
			} ans = (sarray[i]) ans (sarray[i]) sarray i break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static long K;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		K = sc.nextLong();

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	}
} public class Main {
	static long K;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		K = sc.nextLong();

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

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

		String s = String.valueOf(S);
		String[] sarray = s.split("");
		String ans = "1";
		for (int i = 0; i < K; i++) {
			if (!sarray[i].equals("1")) {
				ans = (sarray[i]);
				break;
			}
		}
		System.out.println(ans);
	}
}