import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;


void main() {
    string s;
    long k;

    scan(s);
    scan(k);
    k--;

    int pos = -1;
    char nm = '1';

    foreach (i ; 0 .. s.length) {
        if (s[i] != '1') {
            nm = s[i];
            pos = i.to!int;
            break;
        }
    }

    if (nm == '1') {
        writeln(1);
    }
    else {
        if (k < pos) {
            writeln(1);
        }
        else {
            writeln(nm);
        }
    }
}






















void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
