#include <bits/stdc++.h>
using namespace std;
string s, ss;
double ans;
void tryitry(string s) {
  int x = 0, y = 0, o = 0, fl = 0;
  int l = s.length();
  for (int i = (int)(0); i <= (int)(l - 1); i++) {
    char ch = ((i + y) & 1 ? 'R' : 'L');
    if (s[i] == 'X') continue;
    if (s[i] == ch)
      ++x, fl = 0;
    else
      ++x, ++y, o += fl, fl ^= 1;
  }
  y += l;
  if (y & 1) y++, o += fl;
  if (x * 2 > y) x -= o, y -= 2 * o;
  ans = max(ans, 1.0 * x / y);
}
int main() {
  cin >> s;
  int l = s.length();
  for (int i = (int)(0); i <= (int)(l - 1); i++) {
    if (i && s[i] != 'X' && s[i] == s[i - 1]) ss += 'X';
    ss += s[i];
  }
  if (ss[0] == ss[ss.length() - 1] && ss[0] != 'X')
    tryitry('X' + ss), tryitry(ss + 'X');
  else
    tryitry(ss);
  printf("%.6lf\n", max(0.00, ans * 100 - (0.499) * (1e-6)));
}
