object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val x = sc.nextInt()
  var y = x % 100
  for (i <- 1 to (x / 100)) {
    y match {
      case a if a >= 5 => y -= 5
      case 4 => y -= 4
      case 3 => y -= 3
      case 2 => y -= 2
      case 1 => y -= 1
      case 0 => y
    }
  }
  println(if (y == 0) '1' else '0')
}