Problem: We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is `S`, it means it was sunny on the i-th day; if that character is `R`, it means it was rainy on that day.  Find the maximum number of consecutive rainy days in this period.

Submission attempts (in order):
D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ans_list.append(ans)
      continue
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())

ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    ans = 0
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ans_list.append(ans)
      continue
elif D.count("R") < 1:
  print(0)

D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ans_list.append(ans)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
cons = 0
if D.count("R") >= 1:
  for i in range(3):
    if D[i] != 'R':
      cons = cons
      continue
    elif D[i] == 'R':
      cons += 1
      if D[i] == D[i + 1]:
        cons += 1
      else:
        cons = cons
      if i < 1:
        if D[i + 1] == D[i + 2]:
        cons += 1
      else:
        print(cons)
        break
elif D.count("R") < 1:
  print(0)

D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
      if i <= 1:
        if D[i + 1] == 'S':
          print(max(ans_list))
          break
        elif D[i] == 'R':
          ans += 1
          ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
      if i <= 1:
        if D[i + 1] == 'S':
          print(max(ans_list))
          break
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
cons = 0
if D.count("R") >= 1:
  for i in range(len(D)):
    if D[i] != 'R':
      cons == cons
      continue
    elif D[i] == 'R':
      cons += 1
      if D[i] == D[i + 1]:
        cons += 1
      else:
        cons = cons
      if i < 2:
        if D[i + 1] == D[i + 2]:
        cons += 1
      else:
        print(cons)
        break
elif D.count("R") < 1:
  print(0)
      

D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
      if i <= 1:
        if D[i + 1] == 'S':
          print(max(ans_list))
          break
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
      if D[i + 1] == 'S':
        print(max(ans_list))
        break
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ans_list.append(ans)
  ans_list.sort()
print(ans_list[-1])
elif D.count("R") < 1:
  print(0)


D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted