1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> vFirst;
    int result = 0;

    for (int i = 1; i * i < n; i++) {
        if (n % i== 0) {
            vFirst.push_back(i);
        }
    }

    for (int first : vFirst) {
        int nextN = (n - first) / first;

        for (int i = 2; i * i < nextN; i++) {
            if (nextN % i == 0) {
                result++;
            }
        }
    }

    cout << result << endl;

    return 0;
}