#include <bits/stdc++.h>
using namespace std;
char str[1000010];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> str;
  int n = strlen(str);
  string s;
  for (int i = 0; i < n; ++i) {
    s += str[i];
    if (str[i] == str[i + 1] && str[i] != 'X') s += 'X';
  }
  if (str[0] == str[n - 1]) s = str[0] == 'L' ? (s + 'X') : ('X' + s);
  int p = 0, q = 0, o = 0, f = 0;
  for (char c : s) {
    char w = q & 1 ? 'R' : 'L';
    if (c == 'X')
      ++q;
    else if (c == 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;
  double ans = (double)p / q;
  ans = floor(ans * 1e8) / 1e8;
  cout << fixed << setprecision(6) << 100.0 * ans << endl;
}
