const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;
void (async function () {
// Write your code here
let num = await readline();
let res = [];
for (let i = 1; i < num; i++) {
let tempRes = [];
let currentNum = i
for (let j = 1; j < currentNum; j++) {
if (currentNum % j == 0) {
tempRes.push(j);
}
}
let sum = tempRes.reduce((acc,cur) => { return acc + cur}, 0)
if(sum == currentNum) res.push(sum)
}
console.log(res.length)
})();