Problem: Your friend recently gave you some slimes for your birthday. You have a very large amount of slimes with value 1 and 2, and you decide to invent a game using these slimes.

You initialize a row with n empty spaces. You also choose a number p to be used in the game. Then, you will perform the following steps while the last space is empty. 

  1. With probability <image>, you will choose a slime with value 1, and with probability <image>, you will choose a slime with value 2. You place the chosen slime on the last space of the board. 
  2. You will push the slime to the left as far as possible. If it encounters another slime, and they have the same value v, you will merge the slimes together to create a single slime with value v + 1. This continues on until the slime reaches the end of the board, or encounters a slime with a different value than itself. 



You have played the game a few times, but have gotten bored of it. You are now wondering, what is the expected sum of all values of the slimes on the board after you finish the game.

Input

The first line of the input will contain two integers n, p (1 ≤ n ≤ 109, 1 ≤ p < 109).

Output

Print the expected sum of all slimes on the board after the game finishes. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 4.

Namely, let's assume that your answer is a and the answer of the jury is b. The checker program will consider your answer correct, if <image>.

Examples

Input

2 500000000


Output

3.562500000000000


Input

10 1


Output

64.999983360007620


Input

100 123456789


Output

269.825611298854770

Note

In the first sample, we have a board with two squares, and there is a 0.5 probability of a 1 appearing and a 0.5 probability of a 2 appearing.

Our final board states can be 1 2 with probability 0.25, 2 1 with probability 0.375, 3 2 with probability 0.1875, 3 1 with probability 0.1875. The expected value is thus (1 + 2)·0.25 + (2 + 1)·0.375 + (3 + 2)·0.1875 + (3 + 1)·0.1875 = 3.5625.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 1000;
const int MAXVAL = 60;
const int C = MAXVAL + 1;
typedef double Mat[MAXVAL + 2][MAXVAL + 2];
int N;
double p;
int pp;
double E[MAXVAL + 1][MAXVAL + 3];
double F[MAXVAL + 1][MAXVAL + 2];
double pgeq[MAXVAL + 1][MAXVAL + 3];
double peq[MAXVAL + 1][MAXVAL + 2];
Mat A;
Mat B;
void mmult(Mat &A, Mat &B) {
  static Mat C;
  for (int i = (0); i <= (MAXVAL + 1); ++i)
    for (int j = (0); j <= (MAXVAL + 1); ++j) {
      double cur = 0;
      for (int k = (0); k <= (MAXVAL + 1); ++k) cur += A[i][k] * B[k][j];
      C[i][j] = cur;
    }
  for (int i = (0); i <= (MAXVAL + 1); ++i)
    for (int j = (0); j <= (MAXVAL + 1); ++j) A[i][j] = C[i][j];
}
void mpow(Mat &B, Mat &A, int n) {
  for (int i = (0); i <= (MAXVAL + 1); ++i)
    for (int j = (0); j <= (MAXVAL + 1); ++j) B[i][j] = i == j ? 1 : 0;
  while (n > 0) {
    if (n & 1) mmult(B, A);
    mmult(A, A);
    n /= 2;
  }
}
double EC[MAXVAL + 1][MAXVAL + 2];
double FC[MAXVAL][MAXVAL][MAXVAL + 2];
void addto(double *dst, double mlt, double *src, int shift) {
  for (int i = (shift); i <= (MAXVAL); ++i) dst[i] += mlt * src[i - shift];
  for (int i = (1); i <= (shift); ++i) assert(src[MAXVAL - shift + i] == 0);
  dst[C] += mlt * src[C];
}
void run() {
  scanf("%d%d", &N, &pp);
  p = 0.000000001 * pp;
  if (N == 1) {
    printf("%.9lf\n", p * 1 + (1 - p) * 2);
    return;
  }
  pgeq[1][1] = 1;
  pgeq[1][2] = 1 - p;
  pgeq[1][3] = 0;
  for (int n = (2); n <= (MAXVAL); ++n) {
    pgeq[n][1] = 1;
    pgeq[n][2] = (1 - p) + p * p;
    for (int x = (3); x <= (n + 2); ++x)
      pgeq[n][x] = pgeq[n][x - 1] * pgeq[n - 1][x - 1];
  }
  for (int n = (1); n <= (MAXVAL); ++n)
    for (int x = (1); x <= (n + 1); ++x)
      peq[n][x] = pgeq[n][x] - pgeq[n][x + 1];
  F[0][0] = F[0][1] = E[0][2] = 0;
  for (int n = (1); n <= (MAXVAL); ++n) {
    F[n][0] = 2 + E[n - 1][2];
    for (int x = (1); x <= (n + 1); ++x)
      F[n][x] = peq[n][x] / (1 - pgeq[n][x + 1]) * (x + F[n - 1][x - 1]) +
                (1 - pgeq[n][x]) / (1 - pgeq[n][x + 1]) * F[n][x - 1];
    assert(pgeq[n][n + 2] == 0);
    E[n][n + 2] = F[n][n + 1];
    for (int x = n + 1; x >= 2; --x)
      E[n][x] = pgeq[n][x] * (1 + E[n][x + 1]) + (1 - pgeq[n][x]) * F[n][x - 1];
  }
  for (int j = MAXVAL - 1; j >= 0; --j) {
    FC[j][0][C] += 2;
    FC[j][0][1] += 1;
    for (int x = (1); x <= (MAXVAL - 1 - j); ++x) {
      FC[j][x][C] += peq[x + 1][x] / (1 - pgeq[x + 1][x + 1]) * x;
      addto(FC[j][x], peq[x + 1][x] / (1 - pgeq[x + 1][x + 1]),
            FC[j + 1][x - 1], 1);
      addto(FC[j][x], (1 - pgeq[x][x]) / (1 - pgeq[x + 1][x + 1]), FC[j][x - 1],
            0);
    }
  }
  addto(EC[MAXVAL], 1, FC[0][MAXVAL - 1], 0);
  for (int x = MAXVAL - 1; x >= 2; --x) {
    EC[x][C] += pgeq[x][x];
    addto(EC[x], pgeq[x][x], EC[x + 1], 0);
    addto(EC[x], 1 - pgeq[x][x], FC[0][x - 1], 0);
  }
  for (int i = (0); i < (MAXVAL); ++i) A[i + 1][i] = 1;
  for (int i = (0); i < (MAXVAL); ++i) A[MAXVAL - i][MAXVAL] = EC[2][i + 1];
  A[C][MAXVAL] = EC[2][C];
  A[C][C] = 1;
  mpow(B, A, N - 2);
  double EN1 = B[C][1];
  for (int i = (0); i <= (MAXVAL); ++i) EN1 += B[i][1] * E[i][2];
  double EN2 = B[C][0];
  for (int i = (0); i <= (MAXVAL); ++i) EN2 += B[i][0] * E[i][2];
  double ret = (1 - p + p * p) * (2 + EN1) + p * (1 - p) * (3 + EN2);
  printf("%.9lf\n", ret);
}
int main() {
  run();
  return 0;
}