#include <iostream>
using namespace std;

int main() {
	char s[100];
	int k;
	cin >> s;
	cin >> k;
	for (int i = 0; i < k; i++) {
		if (s[i] != '1') {
			cout << s[i] << endl;
			return 0;
		}
	}
	cout << 1 << endl;
	return 0;
}