program main
  implicit none
  character(len=10) :: S
  integer :: n
  integer,allocatable :: A(:)
  integer :: om
  integer :: out
  integer :: i,j
  read(*,*) S
  n=len(trim(S))
  allocate(A(N))
  A=0
  do i = 1,N
     if (S(i:i)=='A') then
        A(i) = 1
     elseif (S(i:i)=='T') then
        A(i) = 1
     elseif (S(i:i)=='C') then
       A(i) = 1 
     elseif (S(i:i)=='G') then
       A(i) = 1 
     end if
  end do

  out=0
  om=0
  do i = 1,N
     do j = N,j,-1
        if ( sum(A(i:j)) == j-i+1 ) then
           out=j-i+1
           if (out > om ) om = out
        end if
     end do
  end do
  write(*,'(i0)') om
  stop
end program main

; 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
@_QQcl.707929cee050da99c8134971bdb82e36 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4661/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"
@_QQcl.41 = linkonce constant [1 x i8] c"A"
@_QQcl.54 = linkonce constant [1 x i8] c"T"
@_QQcl.43 = linkonce constant [1 x i8] c"C"
@_QQcl.47 = linkonce constant [1 x i8] c"G"
@_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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #2 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = alloca [10 x i8], align 1
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.707929cee050da99c8134971bdb82e36, i32 9)
  %5 = call i1 @_FortranAioInputAscii(ptr %4, ptr nonnull %3, i64 10)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  store ptr %3, ptr %1, align 8, !tbaa !3
  %.fca.1.gep36 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 10, ptr %.fca.1.gep36, align 8, !tbaa !3
  %.fca.2.gep38 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep38, align 8, !tbaa !3
  %.fca.3.gep40 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep40, align 4, !tbaa !3
  %.fca.4.gep42 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep42, align 1, !tbaa !3
  %.fca.5.gep44 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep44, align 2, !tbaa !3
  %.fca.6.gep46 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep46, align 1, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %7 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.707929cee050da99c8134971bdb82e36, i32 10)
  %.fca.0.load = load ptr, ptr %2, align 8, !tbaa !3
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !3
  %8 = trunc i64 %.fca.1.load to i32
  call void @free(ptr %.fca.0.load)
  %sext = shl i64 %.fca.1.load, 32
  %9 = ashr exact i64 %sext, 32
  %10 = call i64 @llvm.smax.i64(i64 %9, i64 0)
  %11 = shl nuw nsw i64 %10, 2
  %12 = call ptr @malloc(i64 %11)
  store ptr %12, ptr @_QFEa.0, align 8, !tbaa !3
  store i64 1, ptr @_QFEa.7, align 8, !tbaa !3
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %15, label %.preheader500

.preheader500:                                    ; preds = %0
  %.not511 = icmp slt i64 %sext, 4294967296
  br i1 %.not511, label %.loopexit, label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.preheader500
  %13 = call i64 @llvm.smax.i64(i64 %9, i64 1)
  %14 = shl nuw nsw i64 %13, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %12, i8 0, i64 %14, i1 false), !tbaa !7
  br label %.lr.ph502.preheader

15:                                               ; preds = %0
  %16 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.707929cee050da99c8134971bdb82e36, i32 12)
  %.unpack484.unpack.unpack = load i64, ptr @_QFEa.7, align 8, !tbaa !3
  %17 = icmp slt i64 %sext, 4294967296
  %18 = select i1 %17, i64 1, i64 %.unpack484.unpack.unpack
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !3
  store i64 %18, ptr @_QFEa.7, align 8, !tbaa !3
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader500, %15
  %19 = icmp sgt i64 %sext, 0
  br i1 %19, label %.lr.ph502.preheader, label %._crit_edge509

.lr.ph502.preheader:                              ; preds = %.loopexit.thread, %.loopexit
  br label %.lr.ph502

.lr.ph508:                                        ; preds = %36
  %.neg = add nsw i64 %9, 1
  %.unpack = load ptr, ptr @_QFEa.0, align 8
  %.unpack424.unpack.unpack = load i64, ptr @_QFEa.7, align 8
  br label %39

.lr.ph502:                                        ; preds = %.lr.ph502.preheader, %36
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 1, %.lr.ph502.preheader ]
  %20 = phi i64 [ %37, %36 ], [ %9, %.lr.ph502.preheader ]
  %21 = add nsw i64 %indvars.iv, -1
  %22 = getelementptr [10 x [1 x i8]], ptr %3, i64 0, i64 %21
  %23 = call i32 @_FortranACharacterCompareScalar1(ptr %22, ptr nonnull @_QQcl.41, i64 1, i64 1)
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %.sink.split, label %25

25:                                               ; preds = %.lr.ph502
  %26 = call i32 @_FortranACharacterCompareScalar1(ptr %22, ptr nonnull @_QQcl.54, i64 1, i64 1)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %.sink.split, label %28

28:                                               ; preds = %25
  %29 = call i32 @_FortranACharacterCompareScalar1(ptr %22, ptr nonnull @_QQcl.43, i64 1, i64 1)
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %.sink.split, label %31

31:                                               ; preds = %28
  %32 = call i32 @_FortranACharacterCompareScalar1(ptr %22, ptr nonnull @_QQcl.47, i64 1, i64 1)
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %.sink.split, label %36

.sink.split:                                      ; preds = %31, %28, %25, %.lr.ph502
  %.unpack465 = load ptr, ptr @_QFEa.0, align 8, !tbaa !3
  %.unpack472.unpack.unpack = load i64, ptr @_QFEa.7, align 8, !tbaa !3
  %34 = sub i64 %indvars.iv, %.unpack472.unpack.unpack
  %35 = getelementptr i32, ptr %.unpack465, i64 %34
  store i32 1, ptr %35, align 4, !tbaa !7
  br label %36

36:                                               ; preds = %.sink.split, %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = add nsw i64 %20, -1
  %38 = icmp sgt i64 %20, 1
  br i1 %38, label %.lr.ph502, label %.lr.ph508

39:                                               ; preds = %.lr.ph508, %._crit_edge
  %indvar = phi i64 [ 0, %.lr.ph508 ], [ %indvar.next, %._crit_edge ]
  %indvars.iv514 = phi i64 [ 1, %.lr.ph508 ], [ %indvars.iv.next515, %._crit_edge ]
  %40 = phi i64 [ %9, %.lr.ph508 ], [ %79, %._crit_edge ]
  %.0507 = phi i32 [ 0, %.lr.ph508 ], [ %.1.lcssa, %._crit_edge ]
  %.0402506 = phi i32 [ undef, %.lr.ph508 ], [ %.lcssa501, %._crit_edge ]
  %41 = xor i64 %indvar, -1
  %42 = sext i32 %.0402506 to i64
  %.neg417 = sub nsw i64 %.neg, %42
  %43 = icmp sgt i64 %.neg417, 0
  br i1 %43, label %.lr.ph504, label %._crit_edge

.lr.ph504:                                        ; preds = %39
  %44 = sub i64 %indvars.iv514, %.unpack424.unpack.unpack
  %45 = getelementptr i32, ptr %.unpack, i64 %44
  %46 = trunc i64 %indvars.iv514 to i32
  br label %47

47:                                               ; preds = %.lr.ph504, %_FortranASumInteger4x1_contract_simplified.exit
  %indvar518 = phi i32 [ 0, %.lr.ph504 ], [ %indvar.next519, %_FortranASumInteger4x1_contract_simplified.exit ]
  %48 = phi i64 [ %.neg417, %.lr.ph504 ], [ %76, %_FortranASumInteger4x1_contract_simplified.exit ]
  %49 = phi i32 [ %8, %.lr.ph504 ], [ %75, %_FortranASumInteger4x1_contract_simplified.exit ]
  %.1503 = phi i32 [ %.0507, %.lr.ph504 ], [ %.2, %_FortranASumInteger4x1_contract_simplified.exit ]
  %50 = sub i32 %8, %indvar518
  %51 = sext i32 %50 to i64
  %52 = add nsw i64 %41, %51
  %smax = call i64 @llvm.smax.i64(i64 %52, i64 -1)
  %53 = add nsw i64 %smax, 1
  %54 = sext i32 %49 to i64
  %55 = sub nsw i64 %54, %indvars.iv514
  %56 = call i64 @llvm.smax.i64(i64 %55, i64 -1)
  %.not498 = icmp slt i64 %55, 0
  br i1 %.not498, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader

.lr.ph.i.preheader:                               ; preds = %47
  %min.iters.check = icmp ult i64 %53, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader522, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %53, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %60, %vector.body ]
  %vec.phi520 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %61, %vector.body ]
  %57 = shl i64 %index, 2
  %58 = getelementptr i8, ptr %45, i64 %57
  %wide.load = load <4 x i32>, ptr %58, align 4, !tbaa !7
  %59 = getelementptr i32, ptr %58, i64 4
  %wide.load521 = load <4 x i32>, ptr %59, align 4, !tbaa !7
  %60 = add <4 x i32> %wide.load, %vec.phi
  %61 = add <4 x i32> %wide.load521, %vec.phi520
  %index.next = add nuw i64 %index, 8
  %62 = icmp eq i64 %index.next, %n.vec
  br i1 %62, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %61, %60
  %63 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %53, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader522

.lr.ph.i.preheader522:                            ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i32 [ 0, %.lr.ph.i.preheader ], [ %63, %middle.block ]
  %.ph523 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader522, %.lr.ph.i
  %64 = phi i32 [ %69, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader522 ]
  %65 = phi i64 [ %70, %.lr.ph.i ], [ %.ph523, %.lr.ph.i.preheader522 ]
  %66 = shl i64 %65, 2
  %67 = getelementptr i8, ptr %45, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !7
  %69 = add i32 %68, %64
  %70 = add nuw nsw i64 %65, 1
  %exitcond.not.i = icmp eq i64 %65, %56
  br i1 %exitcond.not.i, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block, %47
  %.lcssa.i = phi i32 [ 0, %47 ], [ %63, %middle.block ], [ %69, %.lr.ph.i ]
  %71 = sub i32 %49, %46
  %72 = add i32 %71, 1
  %73 = icmp eq i32 %.lcssa.i, %72
  %74 = icmp sgt i32 %72, %.1503
  %or.cond = select i1 %73, i1 %74, i1 false
  %.2 = select i1 %or.cond, i32 %72, i32 %.1503
  %75 = add i32 %49, -1
  %76 = add i64 %48, -1
  %77 = icmp sgt i64 %76, 0
  %indvar.next519 = add i32 %indvar518, 1
  br i1 %77, label %47, label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %78 = add i32 %.0402506, -1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %39
  %.1.lcssa = phi i32 [ %.0507, %39 ], [ %.2, %._crit_edge.loopexit ]
  %.lcssa501 = phi i32 [ %8, %39 ], [ %78, %._crit_edge.loopexit ]
  %indvars.iv.next515 = add nuw nsw i64 %indvars.iv514, 1
  %79 = add nsw i64 %40, -1
  %80 = icmp sgt i64 %40, 1
  %indvar.next = add i64 %indvar, 1
  br i1 %80, label %39, label %._crit_edge509

._crit_edge509:                                   ; preds = %._crit_edge, %.loopexit
  %.0.lcssa = phi i32 [ 0, %.loopexit ], [ %.1.lcssa, %._crit_edge ]
  %81 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.707929cee050da99c8134971bdb82e36, i32 35)
  %82 = call i1 @_FortranAioOutputInteger32(ptr %81, i32 %.0.lcssa)
  %83 = call i32 @_FortranAioEndIoStatement(ptr %81)
  %84 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

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

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

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #2 = { noreturn }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind 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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
