import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr static String INPUT = null; INPUT null private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	} solve {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	} char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		} int i = 0, size = s.length; int i = 0 i 0 size = s.length; size s.length s s.length i < size && i < k i < size i size i < k i k i++ i++ i {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		} {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		} if (s[i] != '1') {
				pr.println(s[i]);
				return;
			} s[i] != '1' s[i] s i '1' {
				pr.println(s[i]);
				return;
			} pr.println(s[i]) pr.println pr s[i] s i return; pr.println(s[(int)k - 1]) pr.println pr s[(int)k - 1] s (int)k - 1 (int)k 1 // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} main {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) sc new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.flush() pr.flush pr String[] args args private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		long k = sc.nextLong();

		for (int i = 0, size = s.length; i < size && i < k; i++) {
			if (s[i] != '1') {
				pr.println(s[i]);
				return;
			}
		}
		
		pr.println(s[(int)k - 1]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
