Language: C++

#include <vector>
#include <algorithm>
#include <map>
#include <cmath>

using namespace std;

typedef unsigned long long ull;


vector <ull> primes;
ull max_prime;

bool is_prime(ull n) {
    ull m;
    int i;
    bool result = true;

    m = int(sqrt(n));

    i = 0;
    while (primes[i] <= m) {
        if (n % primes[i] == 0) {
            // cout << n << " % " << primes[i] << " == 0" << endl;
            result = false;
            break;
        }
        i++;
    }

    return result;
}


void calc_primes(ull n) {
    ull i;

    primes.push_back(2);
    for (i = 3; i <= n; i += 2) {
        if (is_prime(i))
            primes.push_back(i);
    }
}

map <ull,int> decomp(ull n) {
    map <ull,int> prime_count;

    ull m = n;
    int i = 0;
    int n_primes = primes.size();

    while (i < n_primes && primes[i] <= m) {
        if (m % primes[i] == 0) {
            m /= primes[i];

            auto itr = prime_count.find(primes[i]);
            if (itr != prime_count.end()) {
                (itr->second) +=1;
            }
            else {
                prime_count.insert(pair<ull, int>{primes[i],1});
            }
        }
        else {
            i++;
        }
    }
    return prime_count;
}

int main()
{
    ull N;
    cin >> N;

    if (N == 1) {
        cout << 1 << endl;
        exit(0);
    }

    calc_primes(int(sqrt(N)));
    map <ull,int> prime_count = decomp(N);

    if (prime_count.size() == 0) {
        cout << 1 << endl;
        exit(0);
    }

    int n = 0;
    for (auto itr : prime_count) {
        //cout << itr.first << ":" << itr.second << " ";

        int m = itr.second;
        int i = 1;
        while (m >= i) {
            n++;

            m -= i;
            i++;
        }

    }
    cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:5: error: 'cin' was not declared in this scope
   74 |     cin >> N;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <cmath>
  +++ |+#include <iostream>
    5 | 
a.cc:77:9: error: 'cout' was not declared in this scope
   77 |         cout << 1 << endl;
      |         ^~~~
a.cc:77:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:77:22: error: 'endl' was not declared in this scope
   77 |         cout << 1 << endl;
      |                      ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <cmath>
  +++ |+#include <ostream>
    5 | 
a.cc:85:9: error: 'cout' was not declared in this scope
   85 |         cout << 1 << endl;
      |         ^~~~
a.cc:85:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:85:22: error: 'endl' was not declared in this scope
   85 |         cout << 1 << endl;
      |                      ^~~~
a.cc:85:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:103:5: error: 'cout' was not declared in this scope
  103 |     cout << n << endl;
      |     ^~~~
a.cc:103:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:103:18: error: 'endl' was not declared in this scope
  103 |     cout << n << endl;
      |                  ^~~~
a.cc:103:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'