program main
  implicit none
  integer i,N, c1,c2,c3,c4
  character(3) S
  read(*, *)N
  c1 = 0
  c2 = 0
  c3 = 0
  c4 = 0
  do i = 1,N
    read(*, *)S
    if (S == 'AC') then
      c1 = c1+1
    elseif (S == 'WA') then
      c2 = c2+1
    elseif (S == 'TLE') then
      c3 = c3+1
    elseif (S == 'RE') then
      c4 = c4+1
    endif
  enddo
    
  !read(*, *) (L(i), i = 1,N)
  print '("AC x ",i0)',c1
  print '("WA x ",i0)',c2
  print '("TLE x ",i0)',c3
  print '("RE x ",i0)',c4
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"

@_QQcl.290bf65285ae00898b790fda53a9e69f = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_986/source.f\00"
@_QQcl.4143 = linkonce constant [2 x i8] c"AC"
@_QQcl.5741 = linkonce constant [2 x i8] c"WA"
@_QQcl.544C45 = linkonce constant [3 x i8] c"TLE"
@_QQcl.5245 = linkonce constant [2 x i8] c"RE"
@_QQcl.28224143207820222C693029 = linkonce constant [12 x i8] c"(\22AC x \22,i0)"
@_QQcl.28225741207820222C693029 = linkonce constant [12 x i8] c"(\22WA x \22,i0)"
@_QQcl.2822544C45207820222C693029 = linkonce constant [13 x i8] c"(\22TLE x \22,i0)"
@_QQcl.28225245207820222C693029 = linkonce constant [12 x i8] c"(\22RE x \22,i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca [3 x i8], align 1
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %8 = zext i32 %6 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %31
  %9 = phi i64 [ %32, %31 ], [ %8, %.lr.ph.preheader ]
  %.019 = phi i32 [ %.1, %31 ], [ 0, %.lr.ph.preheader ]
  %.0918 = phi i32 [ %.110, %31 ], [ 0, %.lr.ph.preheader ]
  %.01117 = phi i32 [ %.112, %31 ], [ 0, %.lr.ph.preheader ]
  %.01316 = phi i32 [ %.114, %31 ], [ 0, %.lr.ph.preheader ]
  %10 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 11)
  %11 = call i1 @_FortranAioInputAscii(ptr %10, ptr nonnull %2, i64 3)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %10)
  %13 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.4143, i64 3, i64 2)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %.lr.ph
  %16 = add i32 %.01316, 1
  br label %31

17:                                               ; preds = %.lr.ph
  %18 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.5741, i64 3, i64 2)
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = add i32 %.01117, 1
  br label %31

22:                                               ; preds = %17
  %23 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.544C45, i64 3, i64 3)
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = add i32 %.0918, 1
  br label %31

27:                                               ; preds = %22
  %28 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %2, ptr nonnull @_QQcl.5245, i64 3, i64 2)
  %29 = icmp eq i32 %28, 0
  %30 = zext i1 %29 to i32
  %spec.select = add i32 %.019, %30
  br label %31

31:                                               ; preds = %27, %15, %20, %25
  %.114 = phi i32 [ %16, %15 ], [ %.01316, %20 ], [ %.01316, %25 ], [ %.01316, %27 ]
  %.112 = phi i32 [ %.01117, %15 ], [ %21, %20 ], [ %.01117, %25 ], [ %.01117, %27 ]
  %.110 = phi i32 [ %.0918, %15 ], [ %.0918, %20 ], [ %26, %25 ], [ %.0918, %27 ]
  %.1 = phi i32 [ %.019, %15 ], [ %.019, %20 ], [ %.019, %25 ], [ %spec.select, %27 ]
  %32 = add nsw i64 %9, -1
  %33 = icmp sgt i64 %9, 1
  br i1 %33, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %31, %0
  %.013.lcssa = phi i32 [ 0, %0 ], [ %.114, %31 ]
  %.011.lcssa = phi i32 [ 0, %0 ], [ %.112, %31 ]
  %.09.lcssa = phi i32 [ 0, %0 ], [ %.110, %31 ]
  %.0.lcssa = phi i32 [ 0, %0 ], [ %.1, %31 ]
  %34 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28224143207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 24)
  %35 = call i1 @_FortranAioOutputInteger32(ptr %34, i32 %.013.lcssa)
  %36 = call i32 @_FortranAioEndIoStatement(ptr %34)
  %37 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28225741207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 25)
  %38 = call i1 @_FortranAioOutputInteger32(ptr %37, i32 %.011.lcssa)
  %39 = call i32 @_FortranAioEndIoStatement(ptr %37)
  %40 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2822544C45207820222C693029, i64 13, ptr null, i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 26)
  %41 = call i1 @_FortranAioOutputInteger32(ptr %40, i32 %.09.lcssa)
  %42 = call i32 @_FortranAioEndIoStatement(ptr %40)
  %43 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28225245207820222C693029, i64 12, ptr null, i32 -1, ptr nonnull @_QQcl.290bf65285ae00898b790fda53a9e69f, i32 27)
  %44 = call i1 @_FortranAioOutputInteger32(ptr %43, i32 %.0.lcssa)
  %45 = call i32 @_FortranAioEndIoStatement(ptr %43)
  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 i1 @_FortranAioInputAscii(ptr, ptr, i64) 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

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