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