'use strict';

function Main(input) {
  const S = String(input.split('\n')[0]);
  const K = Number(input.split('\n')[1]);

  const checker = (S.search(/[2-9]/)) + 1;

  if(checker === 1) {
    console.log(S.substr(0, 1));
  } else if (checker > K) {
    console.log(1);
  } else {
    console.log(S.substr(checker-1, 1));
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
