#include <bits/stdc++.h>
using namespace std;
string st0, st1;
long double calc(string s) {
  int i, j, p, q, m, f, r;
  p = 0;
  q = 0;
  m = 0;
  f = 0;
  for (i = 0; i < s.length(); i++) {
    if (q % 2 == 0)
      r = 'L';
    else
      r = 'R';
    if (s[i] == 'X')
      q++;
    else if (s[i] == r)
      p++, q++, f = 0;
    else
      p++, q += 2, m += f, f = 1 - f;
  }
  if (q % 2 == 1) q++, m += f;
  if (p * 2 > q) p -= m, q -= m * 2;
  return (long double)p / q;
}
int main() {
  int i, j;
  int p0, p1;
  long double ans;
  cin >> st0;
  st1 = "";
  for (i = 0; i < st0.length(); i++) {
    if (i > 0 && st0[i] == st0[i - 1] && st0[i] != 'X') st1 += 'X';
    st1 += st0[i];
  }
  if (st1[0] == st1[st1.length() - 1] && st1[0] != 'X')
    ans = max(calc('X' + st1), calc(st1 + 'X'));
  else
    ans = calc(st1);
  ans = floor(ans * 1e8) / 1e8;
  printf("%.6lf\n", (double)ans * 1e2);
  return 0;
}
