      MODULE divisorMod
! 約数列挙のためのモジュール
      IMPLICIT NONE
      
      integer,parameter,private :: prec = 16
      
      contains
! 引数Nの約数全て(1-N)を割り付け配列で返す関数．
! N>=1のみ．
      function allDivisor( N ) result( resArray )
        implicit none
        integer(prec),intent(in) :: N
        integer(prec),allocatable :: resArray(:),buffer(:)
        integer(prec) :: i,c
        
        if( N<=0 )then !error
          resArray = [0]
          return
        end if
        
        
        allocate( buffer(floor(sqrt(real(N)))*2) )
        
        !c : counter
        c = 1
        do i = 1,floor(sqrt(real(N+1)))
          if( mod(N,i)==0 )then
            buffer(c) = i
            c = c + 1
          end if
        end do
        
        !c is allways over 1
        c = c - 1
        
        
        if( buffer(c)*buffer(c)==N )then
          !n is Square number
          buffer(c:2*c-1) = N / buffer(c:1:-1)
          c = 2*c - 1
        else
          buffer(c+1:2*c) = N / buffer(c:1:-1)
          c = 2*c
        end if
        
        !c is now number of divisor
        allocate( resArray(1:c) )
        resArray(1:c) = buffer(1:c)
      end function allDivisor
      END MODULE divisorMod
      
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      PROGRAM piyo
      use divisorMod
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      integer(prec) :: n,ans=0,used(10**5),top=0
      integer(prec),allocatable :: div(:)
      
      
      read*,n
      div = allDivisor( n )
      
      used(1) = n
      top = 1
      
      call solve( n )
      
    !  print*,'ans'
      print*,ans
      
      
      
      !stop
      !debugg
      
      print*,used(1:top)
      print*,allDivisor( n )
   !   print*,isP( n )
   !   print*,isPe( n )
      
      contains
      function isP( x ) result( TorF )
        implicit none
        integer(prec),intent(in) :: x
        logical :: TorF
        integer(prec) :: i
        
        if( x==2 )then
          TorF = .true.
          return
        end if
        
        if( x<2 .or. mod(x,2)==0 )then
          TorF = .false.
          return
        end if
        
        i = 3
        do while( .true. )
          if( i>ceiling( sqrt(real(x)) ) )then
            TorF = .true.
            return
          end if
          
          if( mod(x,i)==0 )then
            TorF = .false.
            return
          end if
          
          i = i + 2
        end do
        
      end
      
      function isPE( z ) result( TorF )
        implicit none
        integer(prec),intent(in) :: z
        logical :: TorF
        integer(prec) :: x,numDiv,i
        integer(prec),allocatable :: div(:)
        
        div = allDivisor( z )
        numDiv = size( div )
        if( numDiv==1 )then
          TorF = .false.
          return
        end if
        if( numDiv==2 )then
          TorF = .true.
          return
        end if
        
        outer:&
        do i = 1,numDiv-1
          
          x = div(i)
          if( .not.isP( x ) ) cycle
          do while( .true. )
            
            if( x==z )then
              TorF = .true.
              return
            end if
            
            if( x>z )then
              cycle outer
            end if
            x = x *div(i)
          end do
        end do outer
        TorF = .false.
      end function
      
      recursive subroutine solve( n )
        implicit none
        integer(prec),intent(in) :: n
        integer(prec),allocatable :: div(:)
        integer(prec) :: i,numDiv,j
        
        print*,n,'solve'
        
        div = allDivisor( n )
        numDiv = size(div)
        
        if( numDiv==1 )return
        if( numDiv==2 )then
          ans = ans + 1
          return
        end if
        
        outer:&
        do i = 2,numDiv
          if( .not.isPE(div(i)) )cycle
          
          do j = 1,top
            if( div(i)==used(j) )cycle outer
          end do
          
          top = top + 1
          used(top) = div(i)
      !    print*,used(1:top)
          ans = ans + 1
          call solve( n/div(i) )
          return
        end do outer
      end subroutine
      
      
      
      END PROGRAM