//https://atcoder.jp/contests/abc106/tasks/abc106_c

import java.io.*;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String str = br.readLine();
        long K = Long.parseLong(str);
        if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        }
    }
} import java.io.*; io.* java class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String str = br.readLine();
        long K = Long.parseLong(str);
        if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        }
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String str = br.readLine();
        long K = Long.parseLong(str);
        if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String str = br.readLine();
        long K = Long.parseLong(str);
        if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        }
    } 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 String str = br.readLine(); str br.readLine() br.readLine br long K = Long.parseLong(str); K Long.parseLong(str) Long.parseLong Long str if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        } K!=1 K 1 {
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            } {
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            } if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                } i==K-1 && String.valueOf(S.charAt(i)).equals("1") i==K-1 i K-1 K 1 String.valueOf(S.charAt(i)).equals("1") String.valueOf(S.charAt(i)).equals String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i "1" {
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                } System.out.println(String.valueOf(S.charAt(i))) System.out.println System.out System System.out String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i break; if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                } !String.valueOf(S.charAt(i)).equals("1") String.valueOf(S.charAt(i)).equals("1") String.valueOf(S.charAt(i)).equals String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i "1" {
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                } System.out.println(String.valueOf(S.charAt(i))) System.out.println System.out System System.out String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i break; {
            System.out.println(String.valueOf(S.charAt(0)));
        } System.out.println(String.valueOf(S.charAt(0))) System.out.println System.out System System.out String.valueOf(S.charAt(0)) String.valueOf String S.charAt(0) S.charAt S 0 String[] args args
//https://atcoder.jp/contests/abc106/tasks/abc106_c

import java.io.*;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String str = br.readLine();
        long K = Long.parseLong(str);
        if (K!=1){
            for (int i=0;i<S.length();i++){
                if (i==K-1 && String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
                if (!String.valueOf(S.charAt(i)).equals("1")){
                    System.out.println(String.valueOf(S.charAt(i)));
                    break;
                }
            }
        } else {
            System.out.println(String.valueOf(S.charAt(0)));
        }
    }
}