program ABC169D
    implicit none
    integer(8)::N,c,Ns,i,m,d,ans,j
    integer(8),allocatable,dimension(:)::L
    read*,N
    Ns=int(sqrt(real(N)))
    c=1
    m=N
    ans=0
    allocate(L(Ns+10))
    do i=2,Ns
        if(mod(m,i)==0)then
            d=0
            do
                m=m/i
                d=d+1
                if(mod(m,i)/=0)exit
            end do
            !print'(i0,1x,i0)',i,d
            L(c)=d
            c=c+1
        end if
    end do

    if(m>1)then
        !print'(i0,1x,i0)',m,1
        L(c)=1
    else
        c=c-1
    end if
    !print'(i0)',c
    if(c==0)then
        print'(i0)',0
    else
        do i=1,c
            do j=1,10
                if(2*L(i)<j*(j+1))then
                    ans=ans+j-1
                    exit
                end if
            end do
        end do
        print'(i0)',ans
    end if
end program ABC169D
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEl = internal unnamed_addr global { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { ptr null, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i32 20180515, i8 1, i8 10, i8 2, i8 0, [1 x [3 x i64]] [[3 x i64] [i64 1, i64 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)]] }
@_QQcl.d7e8a13c3486bac327bb82a18794d355 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1304/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d7e8a13c3486bac327bb82a18794d355, i32 5)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 8)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i64, ptr %1, align 8, !tbaa !3
  %6 = sitofp i64 %5 to float
  %7 = call contract float @llvm.sqrt.f32(float %6)
  %8 = fptosi float %7 to i32
  %9 = sext i32 %8 to i64
  %10 = call i64 @llvm.smax.i64(i64 %9, i64 -10)
  %11 = add nsw i64 %10, 10
  %12 = shl nuw nsw i64 %11, 3
  %13 = call ptr @malloc(i64 %12)
  store ptr %13, ptr @_QFEl, align 16, !tbaa !7
  store i64 8, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 3), align 4, !tbaa !7
  store i8 10, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 4), align 1, !tbaa !7
  store i8 2, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 6), align 1, !tbaa !7
  store i64 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 7), align 8, !tbaa !7
  store i64 %11, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 8, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEl, i64 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %14 = icmp sgt i32 %8, 1
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %24
  %.098161 = phi i64 [ %.2, %24 ], [ %5, %0 ]
  %.0100160 = phi i64 [ %25, %24 ], [ 2, %0 ]
  %.0103159 = phi i64 [ %.1104, %24 ], [ 1, %0 ]
  %15 = srem i64 %.098161, %.0100160
  %16 = icmp eq i64 %15, 0
  br i1 %16, label %.preheader155, label %24

.preheader155:                                    ; preds = %.lr.ph, %.preheader155
  %.0102 = phi i64 [ %18, %.preheader155 ], [ 0, %.lr.ph ]
  %.1 = phi i64 [ %17, %.preheader155 ], [ %.098161, %.lr.ph ]
  %17 = sdiv i64 %.1, %.0100160
  %18 = add i64 %.0102, 1
  %19 = srem i64 %17, %.0100160
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %.preheader155, label %20

20:                                               ; preds = %.preheader155
  %21 = add i64 %.0103159, -1
  %22 = getelementptr i64, ptr %13, i64 %21
  store i64 %18, ptr %22, align 8, !tbaa !3
  %23 = add i64 %.0103159, 1
  br label %24

24:                                               ; preds = %20, %.lr.ph
  %.1104 = phi i64 [ %23, %20 ], [ %.0103159, %.lr.ph ]
  %.2 = phi i64 [ %17, %20 ], [ %.098161, %.lr.ph ]
  %25 = add nuw nsw i64 %.0100160, 1
  %exitcond.not = icmp eq i64 %.0100160, %9
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %24, %0
  %.0103.lcssa = phi i64 [ 1, %0 ], [ %.1104, %24 ]
  %.098.lcssa = phi i64 [ %5, %0 ], [ %.2, %24 ]
  %26 = icmp sgt i64 %.098.lcssa, 1
  %27 = add i64 %.0103.lcssa, -1
  br i1 %26, label %28, label %30

28:                                               ; preds = %._crit_edge
  %29 = getelementptr i64, ptr %13, i64 %27
  store i64 1, ptr %29, align 8, !tbaa !3
  br label %30

30:                                               ; preds = %._crit_edge, %28
  %.2105 = phi i64 [ %.0103.lcssa, %28 ], [ %27, %._crit_edge ]
  %31 = icmp eq i64 %.2105, 0
  br i1 %31, label %33, label %.preheader154

.preheader154:                                    ; preds = %30
  %32 = icmp sgt i64 %.2105, 0
  br i1 %32, label %.preheader, label %._crit_edge169

33:                                               ; preds = %30
  %34 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d7e8a13c3486bac327bb82a18794d355, i32 33)
  %35 = call i1 @_FortranAioOutputInteger32(ptr %34, i32 0)
  br label %65

.preheader:                                       ; preds = %.preheader154, %.loopexit
  %.1101168 = phi i64 [ %62, %.loopexit ], [ 1, %.preheader154 ]
  %.0106167 = phi i64 [ %.1107, %.loopexit ], [ 0, %.preheader154 ]
  %36 = add i64 %.1101168, -1
  %37 = getelementptr i64, ptr %13, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !3
  %39 = shl i64 %38, 1
  %40 = icmp slt i64 %39, 2
  br i1 %40, label %59, label %41

41:                                               ; preds = %.preheader
  %42 = icmp ult i64 %39, 6
  br i1 %42, label %59, label %43

43:                                               ; preds = %41
  %44 = icmp ult i64 %39, 12
  br i1 %44, label %59, label %45

45:                                               ; preds = %43
  %46 = icmp ult i64 %39, 20
  br i1 %46, label %59, label %47

47:                                               ; preds = %45
  %48 = icmp ult i64 %39, 30
  br i1 %48, label %59, label %49

49:                                               ; preds = %47
  %50 = icmp ult i64 %39, 42
  br i1 %50, label %59, label %51

51:                                               ; preds = %49
  %52 = icmp ult i64 %39, 56
  br i1 %52, label %59, label %53

53:                                               ; preds = %51
  %54 = icmp ult i64 %39, 72
  br i1 %54, label %59, label %55

55:                                               ; preds = %53
  %56 = icmp ult i64 %39, 90
  br i1 %56, label %59, label %57

57:                                               ; preds = %55
  %58 = icmp ult i64 %39, 110
  br i1 %58, label %59, label %.loopexit

59:                                               ; preds = %57, %55, %53, %51, %49, %47, %45, %43, %41, %.preheader
  %.099164.lcssa = phi i64 [ 1, %.preheader ], [ 2, %41 ], [ 3, %43 ], [ 4, %45 ], [ 5, %47 ], [ 6, %49 ], [ 7, %51 ], [ 8, %53 ], [ 9, %55 ], [ 10, %57 ]
  %60 = add i64 %.0106167, -1
  %61 = add i64 %60, %.099164.lcssa
  br label %.loopexit

.loopexit:                                        ; preds = %57, %59
  %.1107 = phi i64 [ %61, %59 ], [ %.0106167, %57 ]
  %62 = add nuw i64 %.1101168, 1
  %exitcond174.not = icmp eq i64 %.1101168, %.2105
  br i1 %exitcond174.not, label %._crit_edge169, label %.preheader

._crit_edge169:                                   ; preds = %.loopexit, %.preheader154
  %.0106.lcssa = phi i64 [ 0, %.preheader154 ], [ %.1107, %.loopexit ]
  %63 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d7e8a13c3486bac327bb82a18794d355, i32 43)
  %64 = call i1 @_FortranAioOutputInteger64(ptr %63, i64 %.0106.lcssa)
  br label %65

65:                                               ; preds = %33, %._crit_edge169
  %.sink = phi ptr [ %34, %33 ], [ %63, %._crit_edge169 ]
  %66 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.sqrt.f32(float) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #2

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
