program ABC169_D
  integer(8)::M,O,P,k=2,l=1,ans=0
  integer(8),allocatable::A(:)
  double precision::N
  read(*,*)N
  M=dint(N)
  P=M
  O=dint(sqrt(N))
  allocate(A(0:O))
  A=0
  do while(M>1)
     if(mod(M,k)==0) then
        A(k)=A(k)+1
        M=M/k
        if(k>O) then
           A(0)=1
           exit
        end if
     else
        k=k+1
        if(k>O) then
           A(0)=1
           exit
        end if
     end if
  end do
  do i=0,O
     do while(A(i)-l>=0)
        ans=ans+1
        A(i)=A(i)-l
        l=l+1
     end do
     l=1
  end do
  write(*,*)ans
end program ABC169_D
; 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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.7 = internal unnamed_addr global i64 1
@_QFEans = internal unnamed_addr global i64 0
@_QFEk = internal unnamed_addr global i64 2
@_QQcl.98fe27385e7a757b16b1952266558017 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1301/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_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 double, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.98fe27385e7a757b16b1952266558017, i32 5)
  %3 = call i1 @_FortranAioInputReal64(ptr %2, ptr nonnull %1)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load double, ptr %1, align 8, !tbaa !3
  %6 = call contract double @llvm.trunc.f64(double %5)
  %7 = fptosi double %6 to i64
  %8 = call contract double @llvm.sqrt.f64(double %5)
  %9 = call contract double @llvm.trunc.f64(double %8)
  %10 = fptosi double %9 to i64
  %11 = add i64 %10, 1
  %12 = call i64 @llvm.smax.i64(i64 %11, i64 0)
  %13 = shl i64 %12, 3
  %14 = call ptr @malloc(i64 %13)
  %15 = icmp ugt i64 %10, 9223372036854775806
  %16 = zext i1 %15 to i64
  store ptr %14, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %16, ptr @_QFEa.7, align 8, !tbaa !7
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %18, label %.preheader263

.preheader263:                                    ; preds = %0
  br i1 %15, label %.preheader260, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader263
  %17 = shl nuw i64 %11, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %14, i8 0, i64 %17, i1 false), !tbaa !3
  br label %.preheader260

18:                                               ; preds = %0
  %19 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.98fe27385e7a757b16b1952266558017, i32 10)
  %.unpack246.unpack.unpack = load i64, ptr @_QFEa.7, align 8, !tbaa !7
  %20 = select i1 %15, i64 1, i64 %.unpack246.unpack.unpack
  store i64 %20, ptr @_QFEa.7, align 8, !tbaa !7
  br label %.preheader260

.preheader260:                                    ; preds = %.lr.ph.preheader, %.preheader263, %18
  %.unpack198.unpack.unpack = phi i64 [ 0, %.lr.ph.preheader ], [ 1, %.preheader263 ], [ %20, %18 ]
  %_QFEk.promoted265 = load i64, ptr @_QFEk, align 8, !tbaa !3
  br label %.outer

.outer:                                           ; preds = %.preheader260, %25
  %_QFEk.promoted267 = phi i64 [ %_QFEk.promoted265, %.preheader260 ], [ %_QFEk.promoted266, %25 ]
  %.0181.ph = phi i64 [ %7, %.preheader260 ], [ %23, %25 ]
  %21 = icmp sgt i64 %.0181.ph, 1
  br i1 %21, label %.outer.split, label %.loopexit

.outer.split:                                     ; preds = %.outer, %33
  %_QFEk.promoted266 = phi i64 [ %34, %33 ], [ %_QFEk.promoted267, %.outer ]
  %22 = srem i64 %.0181.ph, %_QFEk.promoted266
  %23 = sdiv i64 %.0181.ph, %_QFEk.promoted266
  %24 = icmp eq i64 %22, 0
  br i1 %24, label %25, label %33

25:                                               ; preds = %.outer.split
  %26 = sub i64 %_QFEk.promoted266, %.unpack198.unpack.unpack
  %27 = getelementptr i64, ptr %14, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !3
  %29 = add i64 %28, 1
  store i64 %29, ptr %27, align 8, !tbaa !3
  %30 = icmp sgt i64 %_QFEk.promoted266, %10
  br i1 %30, label %.loopexit261, label %.outer

.loopexit261:                                     ; preds = %25, %33
  %31 = sub i64 0, %.unpack198.unpack.unpack
  %32 = getelementptr i64, ptr %14, i64 %31
  store i64 1, ptr %32, align 8, !tbaa !3
  br label %.loopexit

33:                                               ; preds = %.outer.split
  %34 = add i64 %_QFEk.promoted266, 1
  store i64 %34, ptr @_QFEk, align 8, !tbaa !3
  %35 = icmp sgt i64 %34, %10
  br i1 %35, label %.loopexit261, label %.outer.split

.loopexit:                                        ; preds = %.outer, %.loopexit261
  %36 = trunc i64 %10 to i32
  %37 = icmp ult i32 %36, 2147483647
  br i1 %37, label %.preheader.lr.ph, label %._crit_edge282

.preheader.lr.ph:                                 ; preds = %.loopexit
  %38 = add nuw nsw i32 %36, 1
  %_QFEans.promoted275 = load i64, ptr @_QFEans, align 8, !tbaa !3
  %smin288 = call i32 @llvm.smin.i32(i32 %36, i32 0)
  %39 = sub nuw nsw i32 %38, %smin288
  %wide.trip.count = zext i32 %39 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %51
  %indvars.iv = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next, %51 ]
  %.lcssa270277278 = phi i64 [ %_QFEans.promoted275, %.preheader.lr.ph ], [ %.lcssa270276, %51 ]
  %40 = sub i64 %indvars.iv, %.unpack198.unpack.unpack
  %41 = getelementptr i64, ptr %14, i64 %40
  %.promoted = load i64, ptr %41, align 8, !tbaa !3
  %42 = add i64 %.promoted, -1
  %43 = icmp sgt i64 %42, -1
  br i1 %43, label %.lr.ph269, label %51

.lr.ph269:                                        ; preds = %.preheader, %.lr.ph269
  %44 = phi i64 [ %49, %.lr.ph269 ], [ %42, %.preheader ]
  %45 = phi i64 [ %48, %.lr.ph269 ], [ 1, %.preheader ]
  %46 = phi i64 [ %47, %.lr.ph269 ], [ %.lcssa270277278, %.preheader ]
  %47 = add i64 %46, 1
  %48 = add i64 %45, 1
  %49 = sub i64 %44, %48
  %50 = icmp sgt i64 %49, -1
  br i1 %50, label %.lr.ph269, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph269
  store i64 %47, ptr @_QFEans, align 8, !tbaa !3
  store i64 %44, ptr %41, align 8, !tbaa !3
  br label %51

51:                                               ; preds = %._crit_edge, %.preheader
  %.lcssa270276 = phi i64 [ %47, %._crit_edge ], [ %.lcssa270277278, %.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge282, label %.preheader

._crit_edge282:                                   ; preds = %51, %.loopexit
  %52 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.98fe27385e7a757b16b1952266558017, i32 35)
  %53 = load i64, ptr @_QFEans, align 8, !tbaa !3
  %54 = call i1 @_FortranAioOutputInteger64(ptr %52, i64 %53)
  %55 = call i32 @_FortranAioEndIoStatement(ptr %52)
  ret void
}

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

declare i1 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.trunc.f64(double) #1

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, 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 double @llvm.sqrt.f64(double) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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}
