import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	} main {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.next(); s in.next() in.next in long k = in.nextLong(); k in.nextLong() in.nextLong in if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		} k==1 k 1 System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		} int idx = 0; idx 0 while(s.charAt(idx)=='1' && idx<k-1) idx++; s.charAt(idx)=='1' && idx<k-1 s.charAt(idx)=='1' s.charAt(idx) s.charAt s idx '1' idx<k-1 idx k-1 k 1 idx++ idx System.out.println(s.charAt(idx)) System.out.println System.out System System.out s.charAt(idx) s.charAt s idx in.close() in.close in String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long k = in.nextLong();
		if(k==1) System.out.println(s.charAt(0));
		else {
			int idx = 0;
			while(s.charAt(idx)=='1' && idx<k-1) idx++;
			System.out.println(s.charAt(idx));
		}
		in.close();
	}

}