'use strict'
function main(input) {
  input = input.trim().split('\n')
  const num = input.shift().split('')
  if (num[0] === '1') {
    if (input[0] === '1') {
      return console.log('1')
    }
    while (num.length) {
      num.shift()
      if (num[0] !== '1') break
    }
  }

  console.log(num.length ? num[0] : '1')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
