import 'dart:async';
import 'dart:io';
import 'dart:convert';

import 'dart:math';

Stream<String> get lineStream =>
    stdin.transform(utf8.decoder).transform(const LineSplitter());

Future<List<String>> readLines() async {
  final lines = <String>[];
  await for (var line in lineStream) {
    lines.add(line);
  }
  return lines;
}

void main() async {
  final lines = await readLines();
  final charR = 'R'.codeUnitAt(0);
  var s = List.from(lines[0].runes);
  var r = 0;
  var ans = 0;
  for (var c in s) {
    if (c == charR) {
      ans = max(++r, ans);
    } else {
      ans = max(r, ans);
      r = 0;
    }
  }
  print(ans);
}