import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import java.util.stream.IntStream;
import java.lang.StringBuilder;

public class Main {
  public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.stream.Stream; Stream java.util.stream import java.util.stream.IntStream; IntStream java.util.stream import java.lang.StringBuilder; StringBuilder java.lang public class Main {
  public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  }
} Main public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  } main {

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  } 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 idx = 0; idx 0 for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    } int i = 0; int i = 0; i 0 i < K - 1 i K - 1 K 1 i++ i++ i {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    } {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    } if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      } S.length() <= i S.length() S.length S i {
        idx = S.length() - 1;
        break;
      } idx = S.length() - 1 idx S.length() - 1 S.length() S.length S 1 break; if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      } idx = i idx i break; idx++ idx System.out.println(S.charAt(idx)) System.out.println System.out System System.out S.charAt(idx) S.charAt S idx String[] args args public class Main {
  public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  }
} public class Main {
  public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.Stream;
import java.util.stream.IntStream;
import java.lang.StringBuilder;

public class Main {
  public static void main(String[] args ){

    // 10^15以上は、打ち切りでよい
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int idx = 0;
    for(int i = 0; i < K - 1; i++) {
      if (S.length() <= i ) {
        idx = S.length() - 1;
        break;
      } else if (S.charAt(i) != '1') {
        // = (int)(S.charAt(i) - '0');
        idx = i;
        break;
      }

      idx++;
    }

    System.out.println(S.charAt(idx));
  }
}
