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

class Main {
  public static void main(String[] args) throws Exception{
    try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    }
  }
} import java.util.*; util.* java import java.io.*; io.* java class Main {
  public static void main(String[] args) throws Exception{
    try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    }
  }
} Main public static void main(String[] args) throws Exception{
    try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    }
  } main {
    try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    }
  } try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    } {
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc Double K = sc.nextDouble(); K sc.nextDouble() sc.nextDouble sc if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      } K < 1.5 K 1.5 {
        System.out.println(S.charAt(0));
      } System.out.println(S.charAt(0)) System.out.println System.out System System.out S.charAt(0) S.charAt S 0 {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      } int i = 0; i 0 while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        } i < S.length()-1 && S.charAt(i) == '1' i < S.length()-1 i S.length()-1 S.length() S.length S 1 S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
          i++;
        } i++ i if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        } K < 101.0 && i == K.intValue() K < 101.0 K 101.0 i == K.intValue() i K.intValue() K.intValue K {
          System.out.println('1');
        } System.out.println('1') System.out.println System.out System System.out '1' {
          System.out.println(S.charAt(i));
        } System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i String[] args args
import java.util.*;
import java.io.*;

class Main {
  public static void main(String[] args) throws Exception{
    try (Scanner sc = new Scanner(System.in)){
      String S = sc.next();
      Double K = sc.nextDouble();
      if (K < 1.5) {
        System.out.println(S.charAt(0));
      } else {
        int i = 0;
        while(i < S.length()-1 && S.charAt(i) == '1') {
          i++;
        }
        if (K < 101.0 && i == K.intValue()) {
          System.out.println('1');
        } else {
          System.out.println(S.charAt(i));
        }
      }
    }
  }
}
