import java.util.*;

public class Main {

	static final long r = 5 * (long) Math.pow(10, 15);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	}

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

	static final long r = 5 * (long) Math.pow(10, 15);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	}

} Main static final long r = 5 * (long) Math.pow(10, 15); r 5 * (long) Math.pow(10, 15) 5 (long) Math.pow(10, 15) Math.pow Math 10 15 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				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 sc.close() sc.close sc int n = s.length(); n s.length() s.length s int ans = 1; ans 1 for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		} int i = 0; int i = 0; i 0 i < k i k ++i ++i i {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		} {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		} int tmp = Integer.parseInt(s.substring(i, i + 1)); tmp Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 if(tmp != 1) {
				ans = tmp;
				break;
			} tmp != 1 tmp 1 {
				ans = tmp;
				break;
			} ans = tmp ans tmp break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	static final long r = 5 * (long) Math.pow(10, 15);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	}

} public class Main {

	static final long r = 5 * (long) Math.pow(10, 15);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	}

} Main
import java.util.*;

public class Main {

	static final long r = 5 * (long) Math.pow(10, 15);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();
		int n = s.length();
		int ans = 1;
		for(int i = 0; i < k; ++i) {
			int tmp = Integer.parseInt(s.substring(i, i + 1));
			if(tmp != 1) {
				ans = tmp;
				break;
			}
			
		}
		System.out.println(ans);
	}

}
