import 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();
		String[] s = S.split("");
		String ans = "1";
		if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		System.out.println(ans);
	}

} import java.util.*; util.* java public class Main {

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

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		String[] s = S.split("");
		String ans = "1";
		if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		String[] s = S.split("");
		String ans = "1";
		if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[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 long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc String[] s = S.split(""); s S.split("") S.split S "" String ans = "1"; ans "1" if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		} K <= 100 K 100 {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		} for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			} {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			} if(!s[i].equals("1")) {
					ans = s[i];
					break;
				} !s[i].equals("1") s[i].equals("1") s[i].equals s[i] s i "1" {
					ans = s[i];
					break;
				} ans = s[i] ans s[i] s i break; {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		} for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = 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].equals("1")) {
					ans = s[i];
					break;
				}
			} {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			} if(!s[i].equals("1")) {
					ans = s[i];
					break;
				} !s[i].equals("1") s[i].equals("1") s[i].equals s[i] s i "1" {
					ans = s[i];
					break;
				} ans = s[i] ans s[i] s i break; System.out.println(ans) System.out.println System.out System System.out ans 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();
		String[] s = S.split("");
		String ans = "1";
		if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		System.out.println(ans);
	}

} public class Main {

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

} Main
import 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();
		String[] s = S.split("");
		String ans = "1";
		if(K <= 100) {
			for(int i = 0; i < K; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		else {
			for(int i = 0; i < s.length; i++) {
				if(!s[i].equals("1")) {
					ans = s[i];
					break;
				}
			}
		}
		System.out.println(ans);
	}

}
