program ABC057C
    implicit none
    integer(8)::N,N_sqrt,i,result1,result2
    integer(8)::digit1=0
    integer(8)::digit2=0
    read(5,*)N
    N_sqrt=int(sqrt(real(N)))
    do i=1,N_sqrt
        if(mod(N,i)==0)then
            result1=i
            result2=N/i
        end if
    end do

    do
        result1=result1/10
        digit1=digit1+1
        if(result1<=0)then
            exit
        end if
    end do

    do
        result2=result2/10
        digit2=digit2+1
        if(result2<=0)then
            exit
        end if
    end do

    print'(i0)',max(digit1,digit2)
end program ABC057C
; 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"

@_QFEdigit1 = internal unnamed_addr global i64 0
@_QFEdigit2 = internal unnamed_addr global i64 0
@_QQcl.fb333d55245f9d5a329aa7cf4078f808 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7435/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.fb333d55245f9d5a329aa7cf4078f808, i32 6)
  %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 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph.preheader, label %.preheader13

.lr.ph.preheader:                                 ; preds = %0
  %10 = zext i32 %8 to i64
  %xtraiter = and i64 %10, 1
  %11 = icmp eq i32 %8, 1
  br i1 %11, label %.preheader13.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %10, 4294967294
  br label %.lr.ph

.preheader13.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %23, %.lr.ph ]
  %.015.unr = phi i64 [ undef, %.lr.ph.preheader ], [ %.1.1, %.lr.ph ]
  %.0914.unr = phi i64 [ undef, %.lr.ph.preheader ], [ %.110.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader13, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader13.loopexit.unr-lcssa
  %12 = srem i64 %5, %.unr
  %13 = sdiv i64 %5, %.unr
  %14 = icmp eq i64 %12, 0
  %spec.select = select i1 %14, i64 %.unr, i64 %.0914.unr
  %spec.select26 = select i1 %14, i64 %13, i64 %.015.unr
  br label %.preheader13

.preheader13:                                     ; preds = %.lr.ph.epil, %.preheader13.loopexit.unr-lcssa, %0
  %.09.lcssa = phi i64 [ undef, %0 ], [ %.0914.unr, %.preheader13.loopexit.unr-lcssa ], [ %spec.select, %.lr.ph.epil ]
  %.0.lcssa = phi i64 [ undef, %0 ], [ %.015.unr, %.preheader13.loopexit.unr-lcssa ], [ %spec.select26, %.lr.ph.epil ]
  %_QFEdigit1.promoted = load i64, ptr @_QFEdigit1, align 8, !tbaa !3
  br label %24

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %15 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %23, %.lr.ph ]
  %.015 = phi i64 [ undef, %.lr.ph.preheader.new ], [ %.1.1, %.lr.ph ]
  %.0914 = phi i64 [ undef, %.lr.ph.preheader.new ], [ %.110.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %16 = srem i64 %5, %15
  %17 = sdiv i64 %5, %15
  %18 = icmp eq i64 %16, 0
  %spec.select27 = select i1 %18, i64 %15, i64 %.0914
  %spec.select28 = select i1 %18, i64 %17, i64 %.015
  %19 = add nuw nsw i64 %15, 1
  %20 = srem i64 %5, %19
  %21 = sdiv i64 %5, %19
  %22 = icmp eq i64 %20, 0
  %.110.1 = select i1 %22, i64 %19, i64 %spec.select27
  %.1.1 = select i1 %22, i64 %21, i64 %spec.select28
  %23 = add nuw nsw i64 %15, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader13.loopexit.unr-lcssa, label %.lr.ph

24:                                               ; preds = %.preheader13, %24
  %25 = phi i64 [ %27, %24 ], [ %_QFEdigit1.promoted, %.preheader13 ]
  %.211 = phi i64 [ %26, %24 ], [ %.09.lcssa, %.preheader13 ]
  %26 = udiv i64 %.211, 10
  %27 = add i64 %25, 1
  %28 = icmp slt i64 %.211, 10
  br i1 %28, label %.preheader, label %24

.preheader:                                       ; preds = %24
  store i64 %27, ptr @_QFEdigit1, align 8, !tbaa !3
  %_QFEdigit2.promoted = load i64, ptr @_QFEdigit2, align 8, !tbaa !3
  br label %29

29:                                               ; preds = %.preheader, %29
  %30 = phi i64 [ %32, %29 ], [ %_QFEdigit2.promoted, %.preheader ]
  %.2 = phi i64 [ %31, %29 ], [ %.0.lcssa, %.preheader ]
  %31 = udiv i64 %.2, 10
  %32 = add i64 %30, 1
  %33 = icmp slt i64 %.2, 10
  br i1 %33, label %34, label %29

34:                                               ; preds = %29
  store i64 %32, ptr @_QFEdigit2, align 8, !tbaa !3
  %35 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.fb333d55245f9d5a329aa7cf4078f808, i32 31)
  %36 = load i64, ptr @_QFEdigit1, align 8, !tbaa !3
  %37 = load i64, ptr @_QFEdigit2, align 8, !tbaa !3
  %38 = call i64 @llvm.smax.i64(i64 %36, i64 %37)
  %39 = call i1 @_FortranAioOutputInteger64(ptr %35, i64 %38)
  %40 = call i32 @_FortranAioEndIoStatement(ptr %35)
  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 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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"}
