alexjercan/bugnet huggingface dataset:
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  long long ans = 0, n;
  cin >> n;

  vector<int> score(40);
  int num = 1, point = 1;
  while (num < 40) {
    for (int i = 1; i <= point + 1; i++) {
      score[num] = point;
      num++;
    }
    point++;
  }

  for (long long i = 2; (i * i) <= n; i++) {
    int count = 0;
    while (n % i == 0 && n != 1) {
      n /= i;
      count++;
    }
    ans += score[count];
  }

  // -------------------------
  // 割っていった結果が素数なら1
  // -------------------------
  if (n != 1) {
    ans++;
  }
  // -------------------------

  cout << ans << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  long ans = 0, n, startn;
  cin >> n;
  startn = n;

  vector<int> score(40);
  int num = 1, point = 1;
  while (num < 40) {
    for (int i = 1; i <= point + 1; i++) {
      score[num] = point;
      num++;
    }
    point++;
  }

  for (int i = 2; (i * i) <= n; i++) {
    int count = 0;
    while (n % i == 0 && n != 1) {
      n /= i;
      count++;
    }
    ans += score[count];
  }

  // -------------------------
  // 割っていった結果が素数なら1
  // -------------------------
  if (n != 1) {
    ans++;
  }
  // -------------------------

  cout << ans << endl;

  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string.h>
#include <vector>

typedef long long LL;

constexpr long long INFLL = 1e18;

using namespace std;

map<LL, LL> v;

void isPrime(LL N, LL temp) {
  LL n = N;
  for (LL i = temp; i <= sqrt(N); i++) {
    LL count = 0;

    while (n % i == 0) {
      count++;
      n /= i;
    }
    if (count) {
      v[i] = count;
    }
  }
  if (n != 1) {
    v[N] = 1;
  }
}

int main() {
  LL N;
  cin >> N;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }

  isPrime(N, 2);

  LL count = 0;
  LL temp, sum;
  sum = 0;

  for (LL i = 2; i <= sqrt(N); i++) {
    if (v.count(i)) {
      sum = 0;
      temp = v.at(i);
      for (int k = 1;; k++) {
        sum += k;
        if (sum > temp) {
          break;
        }
        count++;
      }
    }
  }

  if (v.count(N)) {
    count++;
  }

  cout << count << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string.h>
#include <vector>

typedef long long LL;

const long long INF = 1LL << 60;

using namespace std;

bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false; // 偶数はあらかじめ除く

  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      // 素数ではない
      return false;
    }
  }

  // 素数である
  return true;
}

int main() {
  int N;
  cin >> N;
  // N = 24;

  int count = 0;
  int ans = 0;
  int temp = 0;

  for (int i = 2; i <= N; i++) {
    if (IsPrime(i)) {
      temp = 0;
      count = 0;
      while (N % i == 0) {
        count++;
        N /= i;
      }
      for (int k = 1;; k++) {
        temp += k;
        if (count < temp) {
          break;
        } else {
          ans++;
        }
      }
    } else {
      continue;
    }
  }

  cout << ans << endl;

  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  ll n;
  cin >> n;

  vector<pair<ll, int>> a;
  for (ll i = 2; i * i <= n; i++) {
    int x = 0;
    while (n % i == 0) {
      n /= i;
      x++;
    }
    a.emplace_back(i, x);
  }
  if (n != 1)
    a.emplace_back(n, 1);
  int ans = 0;
  for (auto i : a) {
    int x = 1;
    while (i.second - x >= 0) {
      i.second -= x;
      x++;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  ll n;
  cin >> n;

  vector<pair<ll, int>> a;
  for (int i = 2; i * i <= n; i++) {
    int x = 0;
    while (n % i == 0) {
      n /= i;
      x++;
    }
    a.emplace_back(i, x);
  }
  if (n != 1)
    a.emplace_back(n, 1);
  int ans = 0;
  for (auto i : a) {
    int x = 1;
    while (i.second - x >= 0) {
      i.second -= x;
      x++;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int cnt[1000001];

int main() {
  long N, M;
  int ans = 0;
  cin >> N;
  M = N;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 2; i < sqrt((double)N) + 1; i++) {
    if (N % i)
      continue;
    while (N % i == 0) {
      cnt[i]++;
      N /= i;
    }
  }
  if (N == M) {
    cout << 1 << endl;
    return 0;
  }
  if (N != 1)
    ans++;
  for (int i = 2; i < 1000001; i++) {
    if (cnt[i] == 0)
      continue;
    int time = 1;
    while (time <= cnt[i]) {
      ans++;
      cnt[i] -= time;
      time++;
    }
  }
  cout << ans << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int cnt[1000001];

int main() {
  long N, M;
  int ans = 0;
  cin >> N;
  M = N;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 2; i < sqrt((double)N) + 1; i++) {
    if (N % i)
      continue;
    while (N % i == 0) {
      cnt[i]++;
      N /= i;
    }
  }
  if (N == M) {
    cout << 1 << endl;
    return 0;
  }
  cnt[N]++;
  for (int i = 2; i < 1000001; i++) {
    if (cnt[i] == 0)
      continue;
    int time = 1;
    while (time <= cnt[i]) {
      ans++;
      cnt[i] -= time;
      time++;
    }
  }
  cout << ans << endl;
  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define print(a)                                                               \\
  ;                                                                            \\
  for (auto x : a)                                                             \\
    cout << x << " ";                                                          \\
  cout << "\\n";
#define mset(a)                                                                \\
  ;                                                                            \\
  memset(a, 0, sizeof(a));

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n;
  cin >> n;
  ll sum = 0;
  for (ll x = 2; x * x <= n; x++) {
    ll cnt = 0;
    while (n % x == 0) {
      cnt++;
      n /= x;
    }
    if (cnt > 0) {
      ll i = 1;
      while (cnt > 0) {
        cnt -= i;
        i++;
        sum++;
      }
      if (cnt < 0)
        sum--;
    }
  }
  if (n > 1)
    sum++;
  cout << sum << "\\n";
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define print(a)                                                               \\
  ;                                                                            \\
  for (auto x : a)                                                             \\
    cout << x << " ";                                                          \\
  cout << "\\n";
#define mset(a)                                                                \\
  ;                                                                            \\
  memset(a, 0, sizeof(a));

ll cal(ll x) { return x * (x + 1) / 2; }

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n;
  cin >> n;
  ll sum = 0;
  for (int x = 2; x * x <= n; x++) {
    ll cnt = 0;
    while (n % x == 0) {
      cnt++;
      n /= x;
    }
    if (cnt > 0) {
      ll i = 1;
      while (cnt > 0) {
        cnt -= i;
        i++;
        sum++;
      }
      if (cnt < 0)
        sum--;
    }
  }
  if (n > 1)
    sum++;
  cout << sum << "\\n";
}
Problem p02660 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
  long long n;
  int ans = 0;
  cin >> n;
  if (n == 1) {
    cout << ans << endl;
    return 0;
  }
  int num = sqrt(n);
  for (int i = 2; i < num; i++) {
    int e = 1;
    int cnt = 0;
    while ((n % (long long)pow(i, e)) == 0) {
      cnt++;
      n /= pow(i, e);
      e++;
    }
    while (n % i == 0)
      n /= i;
    ans += cnt;
    if (n == 1) {
      cout << ans << endl;
      return 0;
    }
  }
  ans++;
  cout << ans << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> x(n + 1);
  long long num = n;
  for (long long i = 2; i <= n; i++) {
    while (num % i == 0) {
      x.at(i)++;
      num /= i;
    }
  }
  int ans = 0;
  for (long long i = 1; i <= n; i++) {
    int e = 2;
    int cnt = 0;
    while (x[i] > 0) {
      x[i] = x[i] - e;
      cnt++;
      e++;
    }
    ans += cnt;
  }
  cout << ans << endl;
  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

/* D - Div Game */

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  long long N, num;
  int ans = 0;
  cin >> N;
  num = N;
  for (long long p = 2; p <= sqrt(num); p++) {
    int cnt = 0;
    while (num % p == 0) {
      num /= p;
      cnt++;
    }
    for (int i = 1;; i++) {
      if (cnt - i >= 0) {
        cnt -= i;
        ans++;
      } else {
        break;
      }
    }
  }
  // num > 1のときにp <= sqrt(num)を満たすpが存在なければnumは素数
  if (num > 1)
    ans++;
  cout << ans << endl;
}

Error: TLE

Fixed submission:

/* D - Div Game */

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  long long N, num, p = 2;
  int ans = 0;
  cin >> N;
  num = N;
  // p ? even
  if (p == 2) {
    int cnt = 0;
    while (num % p == 0) {
      num /= p;
      cnt++;
    }
    for (int i = 1;; i++) {
      if (cnt - i >= 0) {
        cnt -= i;
        ans++;
      } else {
        break;
      }
    }
  }
  // p ? odd
  for (long long i = 3; num > 1 && i <= num; i += 2) {
    int k = 0;
    for (long long j = 3; j <= sqrt(i); j += 2) {
      if (i % j == 0) {
        k++;
        break;
      }
    }
    if (k == 0)
      p = i;
    int cnt = 0;
    while (num % p == 0) {
      num /= p;
      cnt++;
    }
    for (int j = 1;; j++) {
      if (cnt - j >= 0) {
        cnt -= j;
        ans++;
      } else {
        break;
      }
    }
  }
  cout << ans << endl;
}
Problem p02660 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define ll int64_t
#define _GLIBCXX_DEBUG
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  ll n;
  cin >> n;
  vector<int> v(1000004, 1);
  int ans = 0;
  for (int i = 1; i < 1000000; i++) {
    if (i + 1 > n)
      break;
    if (v.at(i) == 0)
      continue;
    int a = i + 1;
    if ((n % a) == 0) {
      ans++;
      n = n / a;
      if (v.at(i) == 2)
        continue;
      for (int j = 1; j <= 1000000 / a; j++) {
        if (a * j - 1 < 1000000)
          v.at(a * j - 1) = 0;
      }
      ll h = a * a;
      while (1 <= h && h < 1000000) {
        v.at(h - 1) = 2;
        h *= a;
      }
    }
  }
  if (n > 1000000)
    ans++;
  cout << ans << endl;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define ll int64_t
#define _GLIBCXX_DEBUG
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  ll n;
  cin >> n;
  vector<int> v(1000004, 1);
  int ans = 0;
  for (int i = 1; i < 1000000; i++) {
    if (i + 1 > n)
      break;
    if (v.at(i) == 0)
      continue;
    int a = i + 1;
    if ((n % a) == 0) {
      ans++;
      n = n / a;
      if (v.at(i) == 2)
        continue;
      for (int j = 1; j <= 1000000 / a; j++) {
        if (a * j - 1 < 1000000)
          v.at(a * j - 1) = 0;
      }
      ll h = a * a;
      while (h < 1000000) {
        v.at(h - 1) = 2;
        h *= a;
      }
    }
  }
  if (n > 1000000)
    ans++;
  cout << ans << endl;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  long long int n;
  cin >> n;
  long long int ans = 0;
  long long int i = 2;
  long long int waru = i;

  while (n % waru == 0) {
    ans++;
    n /= waru;
    waru *= i;
  }
  waru /= i;
  while (n % i == 0) {
    if (n % waru == 0)
      n /= waru;
    waru /= i;
  }
  for (long long int i = 3; i * i <= n; i += 2) {
    long long int waru = i;
    while (n % waru == 0) {
      ans++;
      n /= waru;
      waru *= i;
    }
    while (n % i == 0) {
      if (n % waru == 0)
        n /= waru;
      waru /= i;
    }
  }
  if (n != 1) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <map>

using namespace std;

int isPrime(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

int main() {
  long long int n;
  cin >> n;
  int ans = 0;
  int i = 2;
  long long int waru = i;
  while (n % waru == 0) {
    ans++;
    n /= waru;
    waru *= i;
  }
  waru /= i;
  while (n % i == 0) {
    if (n % waru == 0)
      n /= waru;
    waru /= i;
  }
  for (int i = 3; i * i <= n; i += 2) {
    long long int waru = i;
    while (n % waru == 0) {
      ans++;
      n /= waru;
      waru *= i;
    }
    while (n % i == 0) {
      if (n % waru == 0)
        n /= waru;
      waru /= i;
    }
  }
  if (n != 1) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;
using lli = long long int;

#define PI 3.14159265358979323846264338327950L

int main() {
  long long N;
  long long div_cnt = 0, z = 1;
  long long i, j;

  cin >> N;

  for (i = 2; i * i <= N; i++) {
    z = 1;
    if (N % i == 0) {
      z *= i;
      while (N % z == 0) {
        // cout << "Z:" << z << ", N, N/Z:" << N_z << ", ";
        N /= z;
        div_cnt++;
        z *= i;
      }

      while (N % i == 0) {
        N /= i;
      }
    }
  }

  // cout << "last_N:" << N << endl;
  if (N != 1) {
    div_cnt++;
  }

  cout << div_cnt << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;
using lli = long long int;

#define PI 3.14159265358979323846264338327950L

bool is_prime(long long N) {
  if (N == 1) {
    return false;
  }
  for (long long i = 2; (i * i) <= N; i++) {
    if (N % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  long long N;
  long long div_cnt = 0, z = 1;
  int i, j;

  cin >> N;

  for (i = 2; i * i <= N; i++) {
    z = 1;
    if (N % i == 0) {
      z *= i;
      while (N % z == 0) {
        // cout << "Z:" << z << ", N, N/Z:" << N_z << ", ";
        N /= z;
        div_cnt++;
        z *= i;
      }

      while (N % i == 0) {
        N /= i;
      }
    }
  }

  // cout << "last_N:" << N << endl;
  if (N != 1) {
    div_cnt++;
  }

  cout << div_cnt << endl;

  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N;
  cin >> N;
  map<long long, long long> prime;
  for (long long i = 2; i * i <= N; i++) {
    while (N % i == 0) {
      prime[i]++;
      N /= i;
    }
  }
  if (N > 1)
    prime[N]++;

  long long ans = 0;

  for (auto p : prime) {
    auto x = p.second;
    for (long long i = 1; x >= i; i++) {
      ans++;
      x -= i;
    }
  }

  cout << ans << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N;
  cin >> N;
  map<int, int> prime;
  for (int i = 2; i * i <= N; i++) {
    while (N % i == 0) {
      prime[i]++;
      N /= i;
    }
  }
  if (N > 1)
    prime[N]++;

  int ans = 0;

  for (auto p : prime) {
    int x = p.second;
    for (int i = 1; x >= i; i++) {
      ans++;
      x -= i;
    }
  }

  cout << ans << endl;
  return 0;
}
Problem p02660 (C++) — buggy submission, verdict: Time Limit Exceeded

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define Q                                                                      \\
  int t;                                                                       \\
  scanf("%d", &t);                                                             \\
  for (int q = 1; q <= t; q++)
typedef long long int lli;
typedef pair<int, int> pi;
#define oset                                                                   \\
  tree<lli, null_type, less<lli>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>
#define ff first
#define ss second

int main() {
  lli n;
  cin >> n;
  map<lli, lli> mp;
  for (lli i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      mp[i]++;
      n /= i;
    }
  }
  if (n != 1)
    mp[n]++;
  lli ans = 0;
  for (auto el : mp) {
    lli x = 1;
    while (el.ss >= x) {
      ans++;
      el.ss -= x;
      x++;
    }
  }
  cout << ans << "\\n";
}


Error: TLE

Fixed submission:

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define Q                                                                      \\
  int t;                                                                       \\
  scanf("%d", &t);                                                             \\
  for (int q = 1; q <= t; q++)
typedef long long int lli;
typedef pair<int, int> pi;
#define oset                                                                   \\
  tree<lli, null_type, less<lli>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>
#define ff first
#define ss second

int main() {
  lli n;
  cin >> n;
  map<lli, lli> mp;
  for (int i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      mp[i]++;
      n /= i;
    }
  }
  if (n != 1)
    mp[n]++;
  lli ans = 0;
  for (auto el : mp) {
    lli x = 1;
    while (el.ss >= x) {
      ans++;
      el.ss -= x;
      x++;
    }
  }
  cout << ans << "\\n";
}
Problem p02660 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <numeric>
#include <string>
#include <vector>
using namespace std;

// 素因数分解
// n : 素因数分解したい数
vector<vector<long long>> decompositePrime(long long n) {
  // 素因数を格納するベクトル配列を初期化
  vector<vector<long long>> prime;
  vector<long long> d;
  prime.clear();
  d.clear();

  // 最小の素因数を格納
  long long a;
  a = 2;

  // √n >= a (n >= a * a)の間ループ処理
  while (n >= a * a) {
    // a で割り切れたら、a は素因数
    // 割り切れる場合、割られる数 n を更新
    if (n % a == 0) {
      // 素因数として格納
      d.push_back(a);
      // n を更新
      n /= a;
    }
    // a で割り切れない場合、a の値を更新
    else {
      a += 1;
      if (d.size() != 0) {
        prime.push_back(d);
        d.clear();
      }
    }
  }

  if (d.size() != 0) {
    prime.push_back(d);
    d.clear();
  }

  // 最後に残った n が 1 でなければ素因数
  if (n != 1) {
    if (prime.size() == 0) {
      d.clear();
      d.push_back(n);
      prime.push_back(d);
    } else if (prime[prime.size() - 1][0] == n) {
      prime[prime.size() - 1].push_back(n);
    } else {
      d.clear();
      d.push_back(n);
      prime.push_back(d);
    }
  }

  return prime;
}

int main() {

  long long N;
  cin >> N;

  vector<vector<long long>> prime = decompositePrime(N);

  long long ans = 0;
  long long cnt;
  long long ind;

  for (long long i = 0; i < prime.size(); i++) {
    cnt = prime[i].size();
    ind = 1;
    cnt -= ind;
    while (cnt >= 0) {
      ans += 1;
      ind += 1;
      cnt -= ind;
    }
  }

  cout << ans << endl;

  return 0;
}


Error: 0

Fixed submission:

#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <numeric>
#include <string>
#include <vector>
using namespace std;

// 素因数分解
// n : 素因数分解したい数
vector<vector<long long>> decompositePrime(long long n) {
  // 素因数を格納するベクトル配列を初期化
  vector<vector<long long>> prime;
  vector<long long> d;
  prime.clear();
  d.clear();

  // 最小の素因数を格納
  long long a;
  a = 2;

  // √n >= a (n >= a * a)の間ループ処理
  while (n >= a * a) {
    // a で割り切れたら、a は素因数
    // 割り切れる場合、割られる数 n を更新
    if (n % a == 0) {
      // 素因数として格納
      d.push_back(a);
      // n を更新
      n /= a;
    }
    // a で割り切れない場合、a の値を更新
    else {
      a += 1;
      if (d.size() != 0) {
        prime.push_back(d);
        d.clear();
      }
    }
  }

  if (d.size() != 0) {
    prime.push_back(d);
    d.clear();
  }

  // 最後に残った n が 1 でなければ素因数
  if (n != 1) {
    if (prime[prime.size() - 1][0] == n) {
      prime[prime.size() - 1].push_back(n);
    } else {
      d.push_back(n);
      prime.push_back(d);
    }
  }

  return prime;
}

int main() {

  long long N;
  cin >> N;

  vector<vector<long long>> prime = decompositePrime(N);

  long long ans = 0;
  long long cnt;
  long long ind;

  for (long long i = 0; i < prime.size(); i++) {
    cnt = prime[i].size();
    ind = 1;
    cnt -= ind;
    while (cnt >= 0) {
      ans += 1;
      ind += 1;
      cnt -= ind;
    }
  }

  cout << ans << endl;

  return 0;
}