import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	}
} import java.util.Scanner; Scanner 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();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	} 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 char[] c = s.toCharArray(); c s.toCharArray() s.toCharArray s for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		} {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		} if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			} c[i]!='1' c[i] c i '1' {
				System.out.println(c[i]);
				System.exit(0);
			} System.out.println(c[i]) System.out.println System.out System System.out c[i] c i System.exit(0) System.exit System 0 System.out.println('1') System.out.println System.out System System.out '1' 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();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		char[] c = s.toCharArray();
		for(int i = 0; i < k; i++) {
			if(c[i]!='1') {
				System.out.println(c[i]);
				System.exit(0);
			}
		}System.out.println('1');
	}
}