#include <iostream>
using namespace std;
int main()
{
  long long k, i=0, ans;
  char s[101];
  cin >> s >> k;
  while(s[i]!='\0'){
	if(i==k-1) break;
    if(s[i]!='1') break;
    i++;
  }
  cout << s[i] <<endl;
  return 0;
}