Problem:
Score : 100 points

Problem Statement

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.

Constraints

|S| = 3

Each character of S is S or R.

Input

Input is given from Standard Input in the following format:

S

Output

Print the maximum number of consecutive rainy days in the period.

Sample Input 1

RRS

Sample Output 1

2

We had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.

Sample Input 2

SSS

Sample Output 2

0

It was sunny throughout the period. We had no rainy days, so we should print 0.

Sample Input 3

RSR

Sample Output 3

1

We had rain on the 1-st and 3-rd days - two "streaks" of one rainy day, so we should print 1.

Solution in C# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	public static void Main(string[] args)
	{
		var s = Console.ReadLine();
		
		if(s == "RRR")
		{
			Console.WriteLine(3);
		}
		else if(s == "RRS" || s == "SRR")
		{
			Console.WriteLine(2);
		}
		else if(s.Contains("R"))
		{
			Console.WriteLine(1);
		}
		else
		{
			Console.WriteLine(0);
		
		}
	}
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

class HeapQueue<T> where T : IComparable<T>
{
	private List<T> _buffer;
	private Comparison<T> _comparer;
	
	public HeapQueue()
	{
		_buffer = new List<T>();
	}
	
	public HeapQueue(int capacity, Comparison<T> comparer = null)
	{
		_buffer = new List<T>(capacity);

		_comparer = comparer;
	}
	
	public void Push(T el)
	{
		List<T> array = _buffer;
		int n = array.Count;
		array.Add(el);
		
		while (n != 0)
		{
			int i = (n - 1) / 2;
			if (Compare(array[n], array[i]) > 0)
			{
				T tmp = array[n]; array[n] = array[i]; array[i] = tmp;
			}
			n = i;
		}
	}
	
	public T Pop()
	{
		T el = _buffer[0];
		
		List<T> array = _buffer;
		
		int n = array.Count - 1;
		array[0] = array[n];
		array.RemoveAt(n);

		for (int i = 0, j; (j = 2 * i + 1) < n; )
		{
			if ((j != n - 1) && (Compare(array[j], array[j + 1]) < 0))
				j++;
			if (Compare(array[i], array[j]) < 0)
			{
				T tmp = array[j]; array[j] = array[i]; array[i] = tmp;
			}
			i = j;
		}
		return el;
	}
	
	public T Peep()
	{
		if(_buffer.Count <= 0)
			return default(T);

		return _buffer[0];
	}
	private int Compare(T left, T right)
	{
		if(_comparer == null)
			return left.CompareTo(right);
		return _comparer(left, right);
	}
	
	public int Count
	{
		get{ return _buffer.Count; }
	}
	
}