fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. long long n;
  7. cin >> n;
  8.  
  9. int count = 0;
  10.  
  11. for (long long i = 2; i * i <= n; i++) {
  12. if (n % i == 0) {
  13. count++;
  14. while (n % i == 0) {
  15. n /= i;
  16. }
  17. }
  18. }
  19.  
  20. if (n > 1) {
  21. count++;
  22. }
  23.  
  24. cout << count << endl;
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
6