import java.util.Scanner;

public class Main {

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k = (int)sc.nextLong();
		char[] cset = s.toCharArray();
		for(int i = 0; i < cset.length; i++) {
			if(cset[i] != '1') {
				System.out.println(cset[i]);
				return;
			}
			if(i == k - 1) {
				System.out.println("1");
				return;
			}
		}
	}
} public class Main {

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

public class Main {

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