      program RainySeason
!variable
      implicit none
      character(len=3) :: S
      integer :: n_rainy
      integer :: n_max
      integer :: i
!read
      read(*,*) S
!
      n_rainy = 0
      n_max = 0
      do i=1,3
        if(S(i:i) == 'R') n_rainy = n_rainy + 1
        if(S(i:i) == 'S') then
          if(n_max < n_rainy) n_max = n_rainy
          n_rainy = 0
        end if
      end do
!
      write(*,*) n_max
!
      end program RainySeason