'use strict';
function Main(input){
  
  let val = Number(input.trim());
  let result = 0;
  let exponents = [];
  
  /*指数を求める
  * target:指数を求める対象の数
  * base:基数
  */
  const getExponent = (target,base) =>{
    let num = target, count = 0;
    while(num%base === 0){
      num = num/base;
      count++;
    }
    if(count !== 0){
      exponents.push(count);
    }
    return num;
  };

  if(val !== 1){
    for(let i = 2; i <= 5; i++){
      val = getExponent(val,i);
    }
    while(val >= 7){
      for(let j = 1; j < val; j++){
      let base = (6*j - 1);
      val = getExponent(val,base);
      base = (6*j + 1);
      val = getExponent(val,base);
      }
    }
  }

  exponents.forEach((data) => {
    for(let k = 1; k <= data; k++){
      data -= k;
      result++;
    }
  });

  console.log(result);
}

// 固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));