
import java.util.Scanner;

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

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	}

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

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

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

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.next(); str scan.next() scan.next scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan int result = 0; result 0 for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		} int i = 0; int i = 0; i 0 i <= k - 1 i k - 1 k 1 i++ i++ i {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		} {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		} if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			} Character.getNumericValue(str.charAt(i)) == 1 Character.getNumericValue(str.charAt(i)) Character.getNumericValue Character str.charAt(i) str.charAt str i 1 {
				result = Character.getNumericValue(str.charAt(i));
			} result = Character.getNumericValue(str.charAt(i)) result Character.getNumericValue(str.charAt(i)) Character.getNumericValue Character str.charAt(i) str.charAt str i {
				result = Character.getNumericValue(str.charAt(i));
				break;
			} result = Character.getNumericValue(str.charAt(i)) result Character.getNumericValue(str.charAt(i)) Character.getNumericValue Character str.charAt(i) str.charAt str i break; System.out.println(result) System.out.println System.out System System.out result scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	}

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

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	}

} Main

import java.util.Scanner;

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

		String str = scan.next();
		long k = scan.nextLong();
		int result = 0;
		for (int i = 0; i <= k - 1; i++) {
			if (Character.getNumericValue(str.charAt(i)) == 1) {
				result = Character.getNumericValue(str.charAt(i));
			} else {
				result = Character.getNumericValue(str.charAt(i));
				break;
			}
		}
		System.out.println(result);
		scan.close();

	}

}