function Main(s){
  s = s.split("\n");
  var k = s[1];
  s = s[0];
  for(var i = 0; i < s.length; i++){
    if(s[i] !== "1"){var ans = s[i]; break;}
  }
  console.log(ans);
}

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