import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(""); str br.readLine().split("") br.readLine().split br.readLine() br.readLine br "" long k = Long.parseLong(br.readLine()); k Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br long one = 0; one 0 for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		} {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		} if (str[i].equals("1")) {
				one++;
			} else {
				break;
			} str[i].equals("1") str[i].equals str[i] str i "1" {
				one++;
			} one++ one {
				break;
			} break; if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		} one >= k one k {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" {
			System.out.println(str[(int) one]);
		} System.out.println(str[(int) one]) System.out.println System.out System System.out str[(int) one] str (int) one String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		long k = Long.parseLong(br.readLine());

		long one = 0;
		for (int i = 0; i < str.length; i++) {
			if (str[i].equals("1")) {
				one++;
			} else {
				break;
			}
		}

		if (one >= k) {
			System.out.println("1");
		} else {
			System.out.println(str[(int) one]);
		}
	}
}
