import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		long K = sc.nextLong() - 1;
		Pattern pattern = Pattern.compile("[2-9]");
		Matcher matcher = pattern.matcher(S);
		if (!matcher.find()) {
			System.out.println(1);
			return;
		}
		int first = matcher.start();
		if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		}
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} import java.util.Scanner; Scanner java.util import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		long K = sc.nextLong() - 1;
		Pattern pattern = Pattern.compile("[2-9]");
		Matcher matcher = pattern.matcher(S);
		if (!matcher.find()) {
			System.out.println(1);
			return;
		}
		int first = matcher.start();
		if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		}
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Scanner sc) {
		String S = sc.next();
		long K = sc.nextLong() - 1;
		Pattern pattern = Pattern.compile("[2-9]");
		Matcher matcher = pattern.matcher(S);
		if (!matcher.find()) {
			System.out.println(1);
			return;
		}
		int first = matcher.start();
		if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		}
	} solve {
		String S = sc.next();
		long K = sc.nextLong() - 1;
		Pattern pattern = Pattern.compile("[2-9]");
		Matcher matcher = pattern.matcher(S);
		if (!matcher.find()) {
			System.out.println(1);
			return;
		}
		int first = matcher.start();
		if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		}
	} String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong() - 1; K sc.nextLong() - 1 sc.nextLong() sc.nextLong sc 1 Pattern pattern = Pattern.compile("[2-9]"); pattern Pattern.compile("[2-9]") Pattern.compile Pattern "[2-9]" Matcher matcher = pattern.matcher(S); matcher pattern.matcher(S) pattern.matcher pattern S if (!matcher.find()) {
			System.out.println(1);
			return;
		} !matcher.find() matcher.find() matcher.find matcher {
			System.out.println(1);
			return;
		} System.out.println(1) System.out.println System.out System System.out 1 return; int first = matcher.start(); first matcher.start() matcher.start matcher if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		} K < first K first {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(S.charAt(first));
		} System.out.println(S.charAt(first)) System.out.println System.out System System.out S.charAt(first) S.charAt S first Scanner sc sc class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} Main public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} main {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Solver.INSTANCE.solve(in) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE in in.close() in.close in String... args args
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		long K = sc.nextLong() - 1;
		Pattern pattern = Pattern.compile("[2-9]");
		Matcher matcher = pattern.matcher(S);
		if (!matcher.find()) {
			System.out.println(1);
			return;
		}
		int first = matcher.start();
		if (K < first) {
			System.out.println(1);
		} else {
			System.out.println(S.charAt(first));
		}
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}