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