import java.util.*;

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

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