"use strict";

function main(input) {
  var lines = input.split('\n');
  var S = lines[0];
  var K = parseInt(lines[1]);
  var l = Math.min(K, S.length);

  for (var i = 0; i < l; i++) {
    if (S[i] !== '1') {
      console.log(S[i]);
      return;
    }
  }

  console.log('1');
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function splitNum(line) {
  return line.split(/\s+/).map(function (n) {
    return parseInt(n);
  });
}
