#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:836777216")
using namespace std;
char s[1111111];
int n;
double solve(string t) {
  n = t.size();
  double res = 0;
  bool s = 0;
  int p = 0, q = 0;
  int x = 0;
  for (int i(0); i < (n); i++) {
    char need = (q % 2 ? 'R' : 'L');
    if (t[i] == 'X')
      q++;
    else if (t[i] == need)
      q++, p++, s = 0;
    else {
      q++;
      p++;
      q++;
      if (s) x++;
      s = !s;
    }
  }
  if (q % 2) {
    q++;
    if (s) x++;
  }
  res = max(res, 100. * p / q);
  res = max(res, 100. * (p - x) / (q - x - x));
  return res;
}
int main() {
  gets(s);
  n = strlen(s);
  string t;
  for (int i(0); i < (n); i++) {
    if (i && s[i] == s[i - 1] && s[i] != 'X') t.push_back('X');
    t.push_back(s[i]);
  }
  double res = 0;
  if (t[0] == t[t.size() - 1] && t[0] != 'X')
    res = max(solve("X" + t), solve(t + "X"));
  else
    res = solve(t);
  int val = res * 1000000 + 1e-9;
  res = val / 1000000.;
  printf("%.6lf\n", res);
  return 0;
}
