#include <bits/stdc++.h>
using namespace std;
int const N = 232;
int const M = (1 << 8) - 1;
double f[N][N][2][M + 1];
void get_state(int x, int &nth, int &cnt, int &mask) {
  mask = x & M, nth = x >> 8 & 1, cnt = 0;
  for (int i = 8; (x >> i & 1) == nth && i < 32; ++cnt, ++i)
    ;
}
int main() {
  int x, k, pp;
  int nth, cnt, mask;
  scanf("%d%d%d", &x, &k, &pp);
  double p = pp / 100.0, q = 1 - p;
  get_state(x, nth, cnt, mask);
  f[0][cnt][nth][mask] = 1;
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < N; ++j)
      for (int b = 0; b < 2; ++b)
        for (int m = 0; m <= M; ++m) {
          double c = f[i][j][b][m];
          int b7 = m >> 7 & 1;
          if (b7 == b)
            cnt = j + 1, nth = b;
          else
            cnt = 1, nth = b7;
          f[i + 1][cnt][nth][(2 * m) & M] += p * c;
          if (m + 1 > M) {
            if (b == 0)
              nth = 1, cnt = 1;
            else
              nth = 0, cnt = j;
          } else {
            nth = b, cnt = j;
          }
          f[i + 1][cnt][nth][(m + 1) & M] += q * c;
        }
  double e = 0;
  for (int i = 0; i < N; ++i)
    for (int b = 0; b < 2; ++b)
      for (int m = 0; m <= M; ++m) {
        int len = 0;
        if (m == 0)
          len = 8 + (b ? 0 : i);
        else
          len = __builtin_ctz(m);
        e += len * f[k][i][b][m];
      }
  printf("%.20lf\n", e);
  return 0;
}
