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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		System.out.println(1);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long K = sc.nextLong();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		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 if (K==1) {
			System.out.println(s.charAt(0));
			return;
		} K==1 K 1 {
			System.out.println(s.charAt(0));
			return;
		} System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 return; for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		} int i=0; int i=0; i 0 i<s.length()&&i<K i<s.length() i s.length() s.length s i<K i K i++ i++ i {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		} {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		} if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			} s.charAt(i)!='1' s.charAt(i) s.charAt s i '1' {
				System.out.println(s.charAt(i));
				return;
			} System.out.println(s.charAt(i)) System.out.println System.out System System.out s.charAt(i) s.charAt s i return; 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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		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();
		if (K==1) {
			System.out.println(s.charAt(0));
			return;
		}
		for (int i=0;i<s.length()&&i<K;i++) {
			if (s.charAt(i)!='1') {
				System.out.println(s.charAt(i));
				return;
			}
		}
		System.out.println(1);
	}
}