import java.util.*;

// ARC 98-D
// https://beta.atcoder.jp/contests/arc098/tasks/arc098_b

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

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    }
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    } main {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in long K = in.nextLong(); K in.nextLong() in.nextLong in char answer = '1'; answer '1' if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		} K < s.length K s.length s s.length {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		} boolean isAnswer1 = true; isAnswer1 true for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			} {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			} if (s[i] != '1') {
					isAnswer1 = false;
				} s[i] != '1' s[i] s i '1' {
					isAnswer1 = false;
				} isAnswer1 = false isAnswer1 false if (isAnswer1) {
				System.out.println(1);
				return;
			} isAnswer1 {
				System.out.println(1);
				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[i] != '1') {
				answer = 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') {
				answer = s[i];
				break;
			}
		} {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		} if (s[i] != '1') {
				answer = s[i];
				break;
			} s[i] != '1' s[i] s i '1' {
				answer = s[i];
				break;
			} answer = s[i] answer s[i] s i break; System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    }
} public class Main {
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    }
} Main
import java.util.*;

// ARC 98-D
// https://beta.atcoder.jp/contests/arc098/tasks/arc098_b

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

		char[] s = in.next().toCharArray();
		long K = in.nextLong();
		
		char answer = '1';
		if (K < s.length) {
			boolean isAnswer1 = true;
			for (int i = 0; i < K; i++) {
				if (s[i] != '1') {
					isAnswer1 = false;
				}
			}
			if (isAnswer1) {
				System.out.println(1);
				return;
			}
		}
		
		for (int i = 0; i < s.length; i++) {
			if (s[i] != '1') {
				answer = s[i];
				break;
			}
		}
		
		System.out.println(answer);
    }
}
