#include <bits/stdc++.h>
using namespace std;
char s[100 * 100 * 100 + 1];
int c[100 * 100 * 100 + 1];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  c[0] = 0;
  if (s[0] == s[n - 1] && s[0] == 'R') c[0] = 1;
  for (int i = 1; i < n; i++) {
    c[i] = c[i - 1];
    if (s[i] == s[i - 1] && s[i] != 'X') c[i]++;
  }
  int d = 0, r = 0, t = 0;
  vector<int> a;
  for (int i = 0; i < n; i++)
    if (s[i] != 'X') {
      if ((s[i] == 'R' && (i + d + c[i]) % 2 == 0 ||
           s[i] == 'L' && (i + d + c[i]) % 2 == 1)) {
        if (d != 0) a.push_back(t);
        d++;
        t = 0;
      }
      t++;
      r++;
    }
  int k = d + n + c[n - 1];
  if (k % 2 != 0) {
    k++;
    a.push_back(t);
  } else if (s[0] == s[n - 1] && s[0] == 'L') {
    k += 2;
    a.push_back(t);
  }
  long double res = ((long double)100 * r) / ((long double)k);
  for (int i = 0; i < a.size(); i++)
    if (res < (((long double)100 * (r - a[i])) / ((long double)(k - 2)))) {
      res = (((long double)100 * (r - a[i])) / ((long double)(k - 2)));
      r -= a[i];
      k -= 2;
      i++;
    }
  r = int(res * 1000000.0);
  res = r / (1000000.0);
  cout.precision(6);
  cout.setf(ios::fixed, ios::floatfield);
  cout << res;
  return 0;
}
