#include <bits/stdc++.h>
using namespace std;
char str[1000005];
pair<int, int> getmax(const pair<int, int>& l, const pair<int, int>& r) {
  return l.first * 1ll * r.second > r.first * 1ll * l.second ? l : r;
}
pair<int, int> gao(const string& s) {
  int n = s.size(), x = 0, y = 0, cnt = 0, rev = 1;
  for (int i = 0; i < n; i++, y++) {
    if (s[i] != 'X')
      x++;
    else
      continue;
    if (s[i] == (y & 1 ? 'R' : 'L'))
      rev = 1;
    else
      cnt += rev ^= 1, y++;
  }
  if (y & 1) y++, cnt += rev ^= 1;
  return getmax({x, y}, {x - cnt, y - cnt * 2});
}
int main() {
  string s;
  gets(str);
  for (int i = 0; str[i]; i++) {
    s += str[i];
    if (str[i] == str[i + 1] && str[i] != 'X') s += 'X';
  }
  int num, den;
  if (s[0] != 'X' && s[0] == s[s.size() - 1]) {
    auto x = gao(s + 'X'), y = gao('X' + s);
    tie(num, den) = getmax(x, y);
  } else {
    tie(num, den) = gao(s);
  }
  printf("%d.%06I64d\n", num * 100 / den, num * 100 % den * 1000000ll / den);
}
