S = gets.chomp.split(//)
children = [1] * S.length
repeat_pattern = []
N = 100
N.times do
  new_children = [0] * S.length
  S.each_with_index do |l_or_r, index|
    case l_or_r
    when "L"
      new_children[index-1] += children[index]
    when "R"
      new_children[index+1] += children[index]
    end
  end
  children = new_children
  if repeat_pattern.empty? || repeat_pattern[0] != children
    repeat_pattern << children
  else
    # リピートに入った
    break
  end
end
puts repeat_pattern[(10**100 % repeat_pattern.count)-1].join(" ")