function Main(input) {
  var ans = Math.floor(input);
  var flag = true;
  var yesLine = 100;
  var yesKosu = 1;
  
  while (flag) {
    if (ans < yesLine) {
      flag = false;
      break;
    }
    if (ans >= yesLine && ans <= yesLine + yesKosu * 5) {
      console.log('1');
      flag = false;
      break;
    }
    yesKosu++;
    yesLine *= yesKosu;
  }
  
  if (flag) {
    console.log('0');
  }
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));