

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	}

	static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	}

	// method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	}

	static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	}

	static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	}

	static String nstr(Scanner sc) {
		return sc.next();
	}

	static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	}

	static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	}

	static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	}

	static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	}

	static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	}

	public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	}

	static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	}

	static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	}

	// method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	}

	static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	}

	static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	}

	static String nstr(Scanner sc) {
		return sc.next();
	}

	static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	}

	static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	}

	static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	}

	static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	}

	static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	}

	public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	}

	static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	}
} Main public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	} main {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	} try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		} catch (Exception e) {
			// DO NOT USE
		} Exception e {
			// DO NOT USE
		} {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} PrintWriter out = new PrintWriter(System.out) PrintWriter out = new PrintWriter(System.out) new PrintWriter(System.out) Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) Task task = new Task(); task new Task() task.solve(sc, out) task.solve task sc out out.flush() out.flush out String[] args args // method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	} nint {
		return Integer.parseInt(sc.next());
	} return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Scanner sc sc static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	} nlong {
		return Long.parseLong(sc.next());
	} return Long.parseLong(sc.next()); Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Scanner sc sc static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	} ndouble {
		return Double.parseDouble(sc.next());
	} return Double.parseDouble(sc.next()); Double.parseDouble(sc.next()) Double.parseDouble Double sc.next() sc.next sc Scanner sc sc static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	} nfloat {
		return Float.parseFloat(sc.next());
	} return Float.parseFloat(sc.next()); Float.parseFloat(sc.next()) Float.parseFloat Float sc.next() sc.next sc Scanner sc sc static String nstr(Scanner sc) {
		return sc.next();
	} nstr {
		return sc.next();
	} return sc.next(); sc.next() sc.next sc Scanner sc sc static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	} longLine {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	} long[] lLine = new long[size]; lLine new long[size] size for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			lLine[i] = nlong(sc);
		} {
			lLine[i] = nlong(sc);
		} lLine[i] = nlong(sc) lLine[i] lLine i nlong(sc) nlong sc return lLine; lLine Scanner sc sc int size size static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	} intLine {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	} int[] iLine = new int[size]; iLine new int[size] size for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			iLine[i] = nint(sc);
		} {
			iLine[i] = nint(sc);
		} iLine[i] = nint(sc) iLine[i] iLine i nint(sc) nint sc return iLine; iLine Scanner sc sc int size size static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	} strLine {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	} String[] strLine = new String[size]; strLine new String[size] size for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			strLine[i] = nstr(sc);
		} {
			strLine[i] = nstr(sc);
		} strLine[i] = nstr(sc) strLine[i] strLine i nstr(sc) nstr sc return strLine; strLine Scanner sc sc int size size static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	} maxFromList {
		return longList.stream().max(Comparator.naturalOrder()).get();
	} return longList.stream().max(Comparator.naturalOrder()).get(); longList.stream().max(Comparator.naturalOrder()).get() longList.stream().max(Comparator.naturalOrder()).get longList.stream().max(Comparator.naturalOrder()) longList.stream().max longList.stream() longList.stream longList Comparator.naturalOrder() Comparator.naturalOrder Comparator List<Long> longList longList static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	} minFromList {
		return longList.stream().min(Comparator.naturalOrder()).get();
	} return longList.stream().min(Comparator.naturalOrder()).get(); longList.stream().min(Comparator.naturalOrder()).get() longList.stream().min(Comparator.naturalOrder()).get longList.stream().min(Comparator.naturalOrder()) longList.stream().min longList.stream() longList.stream longList Comparator.naturalOrder() Comparator.naturalOrder Comparator List<Long> longList longList public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} sumDigits {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} int sum = 0; sum 0 while (n != 0) {
			sum += n % 10;
			n /= 10;
		} n != 0 n 0 {
			sum += n % 10;
			n /= 10;
		} sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} sumDigits {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	} long sum = 0; sum 0 while (n != 0) {
			sum += n % 10;
			n /= 10;
		} n != 0 n 0 {
			sum += n % 10;
			n /= 10;
		} sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum long n n static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	} getIntegerList {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	} List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			list.add(nint(sc));
		} {
			list.add(nint(sc));
		} list.add(nint(sc)) list.add list nint(sc) nint sc return list; list Scanner sc sc int size size static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	} getLongList {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	} List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			list.add(nlong(sc));
		} {
			list.add(nlong(sc));
		} list.add(nlong(sc)) list.add list nlong(sc) nlong sc return list; list Scanner sc sc int size size static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	} Task public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		} solve {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		} String s = nstr(sc); s nstr(sc) nstr sc long k = nlong(sc); k nlong(sc) nlong sc String[] a = s.split(""); a s.split("") s.split s "" int stock = 1; stock 1 int count = 0; count 0 for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			} String string a {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			} {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			} count++ count if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				} string.equals("1") string.equals string "1" {
					continue;

				} continue; {
					stock = Integer.parseInt(string);
					break;
				} stock = Integer.parseInt(string) stock Integer.parseInt(string) Integer.parseInt Integer string break; count-- count if (s.length() == 1) {
				out.print(s);
				return;
			} s.length() == 1 s.length() s.length s 1 {
				out.print(s);
				return;
			} out.print(s) out.print out s return; if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			} a[0].equals("1") && k == 1 a[0].equals("1") a[0].equals a[0] a 0 "1" k == 1 k 1 {
				out.println(1);
				return;
			} out.println(1) out.println out 1 return; if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			} a[0].equals("1") a[0].equals a[0] a 0 "1" {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			} if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				} count >= k count k {
					out.println(1);
					return;
				} out.println(1) out.println out 1 return; {
					out.println(stock);
					return;
				} out.println(stock) out.println out stock return; out.print(a[0]) out.print out a[0] a 0 Scanner sc sc PrintWriter out out public class Main {
	public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	}

	static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	}

	// method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	}

	static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	}

	static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	}

	static String nstr(Scanner sc) {
		return sc.next();
	}

	static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	}

	static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	}

	static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	}

	static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	}

	static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	}

	public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	}

	static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	}
} public class Main {
	public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	}

	static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	}

	// method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	}

	static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	}

	static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	}

	static String nstr(Scanner sc) {
		return sc.next();
	}

	static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	}

	static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	}

	static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	}

	static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	}

	static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	}

	public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	}

	static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	}
} Main


import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in);) {
			Task task = new Task();
			task.solve(sc, out);
			out.flush();

		} catch (Exception e) {
			// DO NOT USE
		}
	}

	static class Task {
		public void solve(Scanner sc, PrintWriter out) {
			// TODO
			String s = nstr(sc);
			long k = nlong(sc);
			String[] a = s.split("");

			int stock = 1;
			int count = 0;
			for (String string : a) {
				count++;
				if (string.equals("1")) {
					continue;

				} else {
					stock = Integer.parseInt(string);
					break;
				}
			}
			count--;

			if (s.length() == 1) {
				out.print(s);
				return;
			}
			if (a[0].equals("1") && k == 1) {
				out.println(1);
				return;
			}
			if (a[0].equals("1")) {
				if (count >= k) {
					out.println(1);
					return;
				} else {
					out.println(stock);
					return;
				}
			}

			out.print(a[0]);

		}
	}

	// method
	static int nint(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	static long nlong(Scanner sc) {
		return Long.parseLong(sc.next());
	}

	static double ndouble(Scanner sc) {
		return Double.parseDouble(sc.next());
	}

	static float nfloat(Scanner sc) {
		return Float.parseFloat(sc.next());
	}

	static String nstr(Scanner sc) {
		return sc.next();
	}

	static long[] longLine(Scanner sc, int size) {
		long[] lLine = new long[size];
		for (int i = 0; i < size; i++) {
			lLine[i] = nlong(sc);
		}
		return lLine;
	}

	static int[] intLine(Scanner sc, int size) {
		int[] iLine = new int[size];
		for (int i = 0; i < size; i++) {
			iLine[i] = nint(sc);
		}
		return iLine;
	}

	static String[] strLine(Scanner sc, int size) {
		String[] strLine = new String[size];
		for (int i = 0; i < size; i++) {
			strLine[i] = nstr(sc);
		}
		return strLine;
	}

	static long maxFromList(List<Long> longList) {
		return longList.stream().max(Comparator.naturalOrder()).get();
	}

	static long minFromList(List<Long> longList) {
		return longList.stream().min(Comparator.naturalOrder()).get();
	}

	public static int sumDigits(int n) {
		int sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	public static long sumDigits(long n) {
		long sum = 0;
		while (n != 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}

	static List<Integer> getIntegerList(Scanner sc, int size) {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nint(sc));
		}
		return list;
	}

	static List<Long> getLongList(Scanner sc, int size) {
		List<Long> list = new ArrayList<>();
		for (int i = 0; i < size; i++) {
			list.add(nlong(sc));
		}
		return list;
	}
}