program answer
  implicit none
  character(len=3) :: S
  read(*,*) S
  if(S(1:1)=='R'.and.S(2:2)=='R'.and.S(3:3)=='R') then
     write(*,*) '3'
     stop
  else if(S(1:1)=='R'.and.S(2:2)=='R'.and.S(3:3)=='S') then
     write(*,*) '2'
  else if(S(1:1)=='S'.and.S(2:2)=='R'.and.S(3:3)=='R') then
     write(*,*) '2'
  else if(S(1:1)=='S'.and.S(2:2)=='S'.and.S(3:3)=='S') then
     write(*,*) '0'
  else
     write(*,*) '1'
  end if

  stop
 end program answer
; 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.2b0cff7d6f114850c101a9b5011a7ff0 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_792/source.f\00"
@_QQcl.52 = linkonce constant [1 x i8] c"R"
@_QQcl.33 = linkonce constant [1 x i8] c"3"
@_QQcl.53 = linkonce constant [1 x i8] c"S"
@_QQcl.32 = linkonce constant [1 x i8] c"2"
@_QQcl.30 = linkonce constant [1 x i8] c"0"
@_QQcl.31 = linkonce constant [1 x i8] c"1"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca [3 x i8], align 1
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2b0cff7d6f114850c101a9b5011a7ff0, i32 4)
  %3 = call i1 @_FortranAioInputAscii(ptr %2, ptr nonnull %1, i64 3)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %1, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %6 = getelementptr inbounds [3 x [1 x i8]], ptr %1, i64 0, i64 1
  %7 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %6, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %8 = or i32 %7, %5
  %9 = getelementptr inbounds [3 x [1 x i8]], ptr %1, i64 0, i64 2
  %10 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %9, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %11 = or i32 %8, %10
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %18

13:                                               ; preds = %0
  %14 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.2b0cff7d6f114850c101a9b5011a7ff0, i32 6)
  %15 = call i1 @_FortranAioOutputAscii(ptr %14, ptr nonnull @_QQcl.33, i64 1)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %17 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

18:                                               ; preds = %0
  %19 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %1, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %20 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %6, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %21 = or i32 %20, %19
  %22 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %9, ptr nonnull @_QQcl.53, i64 1, i64 1)
  %23 = or i32 %21, %22
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %39, label %25

25:                                               ; preds = %18
  %26 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %1, ptr nonnull @_QQcl.53, i64 1, i64 1)
  %27 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %6, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %28 = or i32 %27, %26
  %29 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %9, ptr nonnull @_QQcl.52, i64 1, i64 1)
  %30 = or i32 %28, %29
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %39, label %32

32:                                               ; preds = %25
  %33 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %1, ptr nonnull @_QQcl.53, i64 1, i64 1)
  %34 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %6, ptr nonnull @_QQcl.53, i64 1, i64 1)
  %35 = or i32 %34, %33
  %36 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %9, ptr nonnull @_QQcl.53, i64 1, i64 1)
  %37 = or i32 %35, %36
  %38 = icmp eq i32 %37, 0
  %. = select i1 %38, i32 13, i32 15
  %_QQcl.30._QQcl.31 = select i1 %38, ptr @_QQcl.30, ptr @_QQcl.31
  br label %39

39:                                               ; preds = %32, %25, %18
  %.sink = phi i32 [ 9, %18 ], [ 11, %25 ], [ %., %32 ]
  %_QQcl.32.sink = phi ptr [ @_QQcl.32, %18 ], [ @_QQcl.32, %25 ], [ %_QQcl.30._QQcl.31, %32 ]
  %40 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.2b0cff7d6f114850c101a9b5011a7ff0, i32 %.sink)
  %41 = call i1 @_FortranAioOutputAscii(ptr %40, ptr nonnull %_QQcl.32.sink, i64 1)
  %42 = call i32 @_FortranAioEndIoStatement(ptr %40)
  %43 = 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 i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

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

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

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

attributes #0 = { noreturn }

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