import java.lang.*;
import java.io.*;
import java.util.*;

class Main{
	public static void main(String args[]) throws FileNotFoundException{
		FScanner fs=new FScanner();
		//Scanner sc=new Scanner(System.in);
		
		String[] s=fs.readStringL();
		long k=fs.readLong();
		int head=0;
		
		for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		}
		
		if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		}
	}
	
	static void solver(){
		
	}

	static void disp(int[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	}
	
	static class FScanner{
		Scanner sc;
		FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		}
		boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		}
		int readInt(){
			int i=Integer.parseInt(sc.nextLine());
			return i;
		}
		long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		}
		int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		}
		
		String readString(){
			return sc.nextLine();
		}
		String[] readStringL(){
			String[] s=sc.nextLine().split("");
			return s;
		}
	}
} import java.lang.*; lang.* java import java.io.*; io.* java import java.util.*; util.* java class Main{
	public static void main(String args[]) throws FileNotFoundException{
		FScanner fs=new FScanner();
		//Scanner sc=new Scanner(System.in);
		
		String[] s=fs.readStringL();
		long k=fs.readLong();
		int head=0;
		
		for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		}
		
		if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		}
	}
	
	static void solver(){
		
	}

	static void disp(int[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	}
	
	static class FScanner{
		Scanner sc;
		FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		}
		boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		}
		int readInt(){
			int i=Integer.parseInt(sc.nextLine());
			return i;
		}
		long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		}
		int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		}
		
		String readString(){
			return sc.nextLine();
		}
		String[] readStringL(){
			String[] s=sc.nextLine().split("");
			return s;
		}
	}
} Main public static void main(String args[]) throws FileNotFoundException{
		FScanner fs=new FScanner();
		//Scanner sc=new Scanner(System.in);
		
		String[] s=fs.readStringL();
		long k=fs.readLong();
		int head=0;
		
		for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		}
		
		if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		}
	} main {
		FScanner fs=new FScanner();
		//Scanner sc=new Scanner(System.in);
		
		String[] s=fs.readStringL();
		long k=fs.readLong();
		int head=0;
		
		for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		}
		
		if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		}
	} FScanner fs=new FScanner(); fs new FScanner() String[] s=fs.readStringL(); s fs.readStringL() fs.readStringL fs long k=fs.readLong(); k fs.readLong() fs.readLong fs int head=0; head 0 for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		} int i=0; int i=0; i 0 i<s.length && s[i].equals("1") i<s.length i s.length s s.length s[i].equals("1") s[i].equals s[i] s i "1" i++ i++ i {
			head++;
		} {
			head++;
		} head++ head if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		} k<=head k head {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" {
			System.out.println(s[head]);
		} System.out.println(s[head]) System.out.println System.out System System.out s[head] s head String args[] args static void solver(){
		
	} solver {
		
	} static void disp(int[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	} disp {
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	} for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		} int i=0; int i=0; i 0 i<data.length i data.length data data.length i++ i++ i {
				System.out.printf("%d ",data[i]);
		} {
				System.out.printf("%d ",data[i]);
		} System.out.printf("%d ",data[i]) System.out.printf System.out System System.out "%d " data[i] data i System.out.println() System.out.println System.out System System.out int[] data data static class FScanner{
		Scanner sc;
		FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		}
		boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		}
		int readInt(){
			int i=Integer.parseInt(sc.nextLine());
			return i;
		}
		long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		}
		int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		}
		
		String readString(){
			return sc.nextLine();
		}
		String[] readStringL(){
			String[] s=sc.nextLine().split("");
			return s;
		}
	} FScanner Scanner sc; sc FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		} FScanner {
			sc=new Scanner(System.in);
		} sc=new Scanner(System.in) sc new Scanner(System.in) boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		} hasNextLine {
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		} boolean has=true; has true if(!sc.hasNextLine()){
				has=false;
			} !sc.hasNextLine() sc.hasNextLine() sc.hasNextLine sc {
				has=false;
			} has=false has false return has; has int readInt(){
			int i=Integer.parseInt(sc.nextLine());
			return i;
		} readInt {
			int i=Integer.parseInt(sc.nextLine());
			return i;
		} int i=Integer.parseInt(sc.nextLine()); i Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc return i; i long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		} readLong {
			long i=Long.parseLong(sc.nextLine());
			return i;
		} long i=Long.parseLong(sc.nextLine()); i Long.parseLong(sc.nextLine()) Long.parseLong Long sc.nextLine() sc.nextLine sc return i; i int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		} readIntL {
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		} String[] buf=sc.nextLine().split(" "); buf sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int[] num=new int[buf.length]; num new int[buf.length] buf.length buf buf.length for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			} int i=0; int i=0; i 0 i<buf.length i buf.length buf buf.length i++ i++ i {
				num[i]=Integer.parseInt(buf[i]);
			} {
				num[i]=Integer.parseInt(buf[i]);
			} num[i]=Integer.parseInt(buf[i]) num[i] num i Integer.parseInt(buf[i]) Integer.parseInt Integer buf[i] buf i return num; num String readString(){
			return sc.nextLine();
		} readString {
			return sc.nextLine();
		} return sc.nextLine(); sc.nextLine() sc.nextLine sc String[] readStringL(){
			String[] s=sc.nextLine().split("");
			return s;
		} readStringL {
			String[] s=sc.nextLine().split("");
			return s;
		} String[] s=sc.nextLine().split(""); s sc.nextLine().split("") sc.nextLine().split sc.nextLine() sc.nextLine sc "" return s; s
import java.lang.*;
import java.io.*;
import java.util.*;

class Main{
	public static void main(String args[]) throws FileNotFoundException{
		FScanner fs=new FScanner();
		//Scanner sc=new Scanner(System.in);
		
		String[] s=fs.readStringL();
		long k=fs.readLong();
		int head=0;
		
		for(int i=0; i<s.length && s[i].equals("1"); i++){
			head++;
		}
		
		if(k<=head){
			System.out.println("1");
		}else{
			System.out.println(s[head]);
		}
	}
	
	static void solver(){
		
	}

	static void disp(int[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	}
	
	static class FScanner{
		Scanner sc;
		FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		}
		boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		}
		int readInt(){
			int i=Integer.parseInt(sc.nextLine());
			return i;
		}
		long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		}
		int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		}
		
		String readString(){
			return sc.nextLine();
		}
		String[] readStringL(){
			String[] s=sc.nextLine().split("");
			return s;
		}
	}
}
