import java.util.HashSet;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }
    
    
} import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }
    
    
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br long k =  Long.parseLong(br.readLine()); k Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br char ans = '1'; ans '1' for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        } {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        } if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            } s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' {
                ans = s.charAt(i);
                break;
            } ans = s.charAt(i) ans s.charAt(i) s.charAt s i 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) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }
    
    
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }
    
    
} Main
import java.util.HashSet;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        long k =  Long.parseLong(br.readLine());
        
        char ans = '1';
        
        //if 
        for (int i = 0; i < k; i++) {
            if (s.charAt(i) != '1') {
                ans = s.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }
    
    
}
