// 標準入力
var fs = require('fs'),
length = fs.fstatSync(process.stdin.fd).size,
buffer = new Buffer(length),
bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();
 
// ここから
function main(){
  for(var line = 0, inputLength = input.length; line < inputLength - 1; line++){
    var target = input[line] - 0;
    var count = 1;
    
    for(var i = 3, max = ~~Math.sqrt(target); i < max; i+=2){
      if(!(target % i)){
        break;
      }

      count++;
    }

    console.log(count);
  }
}