import java.util.Scanner;

public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	}
} Main static int[] subTreeSize; subTreeSize public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	} 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 k-- k int idx = 0; idx 0 for (;idx < s.length() && s.charAt(idx) == '1'; idx++); ; idx < s.length() && s.charAt(idx) == '1' idx < s.length() idx s.length() s.length s s.charAt(idx) == '1' s.charAt(idx) s.charAt s idx '1' idx++ idx++ idx ; char ans = k < idx ? '1' : s.charAt(idx); ans k < idx ? '1' : s.charAt(idx) k < idx k idx '1' s.charAt(idx) s.charAt s idx System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	}
} public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	static int[] subTreeSize;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		k--;
		int idx = 0;
		for (;idx < s.length() && s.charAt(idx) == '1'; idx++);
		char ans = k < idx ? '1' : s.charAt(idx);
		System.out.println(ans);
	}
}
