#include <bits/stdc++.h>
using namespace std;
int i, j, k, N, M, K, x;
long double dp[2][(1 << 9)][2][405], p, dv, ans;
int spmask = (1 << 8) - 1, mask, cnt, last, nmask, ncnt, nlast, ni;
int main() {
  memset(dp, 0, sizeof(dp));
  ans = 0;
  cnt = last = mask = 0;
  cin >> x >> k >> p;
  p /= 100;
  mask = x & (spmask);
  N = x >> 8;
  M = N % 2;
  while (N % 2 == M && N != 0) {
    cnt++;
    N /= 2;
  }
  cout << fixed << setprecision(10);
  dp[0][mask][M][cnt] = 1.0;
  int c;
  for (c = 0; c <= k; c++) {
    i = c % 2;
    for (mask = 0; mask <= (1 << 8) - 1; mask++) {
      for (last = 0; last <= 1; last++) {
        for (cnt = 0; cnt <= 400; cnt++) {
          dp[i ^ 1][mask][last][cnt] = 0;
        }
      }
    }
    for (mask = 0; mask <= (1 << 8) - 1; mask++) {
      for (last = 0; last <= 1; last++) {
        for (cnt = 0; cnt <= 400; cnt++) {
          dv = dp[i][mask][last][cnt];
          ni = (i + 1) % 2, nmask = (mask + 1) & spmask;
          if (nmask == 0) {
            if (last == 0) {
              nlast = 1, ncnt = 1;
            } else {
              ncnt = cnt, nlast = 0;
            }
          } else {
            nlast = last, ncnt = cnt;
          }
          dp[ni][nmask][nlast][ncnt] += (1 - p) * dv;
          ni = (i + 1) % 2, nmask = (mask << 1) & spmask,
          nlast = ((1 << 7) & mask) > 0;
          if (last == nlast) {
            ncnt = cnt + 1;
          } else {
            ncnt = 1;
          }
          dp[ni][nmask][nlast][ncnt] += p * dv;
          if (i == 0 && mask == 255 && last == 0 && cnt == 0) {
          }
        }
      }
    }
  }
  for (c = k; c <= k; c++) {
    int i = c % 2;
    for (mask = 0; mask <= (1 << 8) - 1; mask++) {
      for (last = 0; last <= 1; last++) {
        for (cnt = 0; cnt <= 400; cnt++) {
          int ret = 0;
          if (mask == 0) {
            ret = 8;
            if (last == 0) {
              ret += cnt;
            }
          } else {
            N = mask;
            while (N != 0 && N % 2 == 0) ret++, N /= 2;
          }
          ans += ret * dp[i][mask][last][cnt];
        }
      }
    }
  }
  cout << ans << endl;
}
