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();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	}

} 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();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	} 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 int ans = 0; ans 0 for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		} {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		} if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			} !s.substring(i, i+1).equals("1") s.substring(i, i+1).equals("1") s.substring(i, i+1).equals s.substring(i, i+1) s.substring s i i+1 i 1 "1" {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			} ans = Integer.valueOf(s.substring(i, i+1)) ans Integer.valueOf(s.substring(i, i+1)) Integer.valueOf Integer s.substring(i, i+1) s.substring s i i+1 i 1 break; if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		} ans == 0 ans 0 {
			System.out.println(1);	
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	}

} 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();
		int ans = 0;

		for (int i = 0; i < k; i++) {
			if (!s.substring(i, i+1).equals("1")) {
				ans = Integer.valueOf(s.substring(i, i+1));
				break;
			}
		}
		
		if (ans == 0) {
			System.out.println(1);	
		} else {
			System.out.println(ans);
		}
		
		sc.close();
	}

}
