import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan char[] c = new char[s.length()]; c new char[s.length()] s.length() s.length s for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			c[i] = s.charAt(i);
		} {
			c[i] = s.charAt(i);
		} c[i] = s.charAt(i) c[i] c i s.charAt(i) s.charAt s i boolean f = true; f true char result = '1'; result '1' for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		} {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		} if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			} c[i] != '1' c[i] c i '1' {
				f = false;
				result = c[i];
				break;
			} f = false f false result = c[i] result c[i] c i break; if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		} f {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(result);
		} System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		long k = scan.nextLong();
		char[] c = new char[s.length()];
		for (int i = 0; i < s.length(); i++) {
			c[i] = s.charAt(i);
		}
		boolean f = true;
		char result = '1';
		for (int i = 0; i < k; i++) {
			if (c[i] != '1') {
				f = false;
				result = c[i];
				break;
			}
		}
		if (f) {
			System.out.println(1);
		} else {
			System.out.println(result);
		}
	}
}
