import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.next() s sc.next() sc.next sc ans="1"; ans "1" long n=sc.nextLong(); n sc.nextLong() sc.nextLong sc for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		} {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		} if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			} !s.substring(i, i+1).equals("1") s.substring(i, i+1).equals("1") s.substring(i, i+1).equals s.substring(i, i+1) s.substring s i i+1 i 1 "1" {
				ans=s.substring(i,i+1);
				break;
			} ans=s.substring(i,i+1) ans s.substring(i,i+1) s.substring s i i+1 i 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),ans="1";
		long n=sc.nextLong();
		for(int i=0;i<n;i++) {
			if(!s.substring(i, i+1).equals("1")) {
				ans=s.substring(i,i+1);
				break;
			}
		}
		System.out.println(ans);
	}
}
