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.
#include <bits/stdc++.h>
const size_t maxN = 1005;
const int pppp = 100;
int N, P;
long double A[maxN][maxN], B[maxN][maxN], F[maxN][maxN];
struct matrix_t {
  long double a[pppp + 3][pppp + 3];
  inline long double *operator[](int x) { return a[x]; }
  inline const long double *operator[](int x) const { return a[x]; }
} T;
matrix_t operator*(const matrix_t &x, const matrix_t &y) {
  matrix_t res;
  for (int i = 1; i <= pppp + 1; ++i)
    for (int j = 1; j <= pppp + 1; ++j) {
      res[i][j] = 0.0;
      for (int k = 1; k <= pppp + 1; ++k) res[i][j] += x[i][k] * y[k][j];
    }
  return res;
}
matrix_t operator^(matrix_t base, int exp) {
  matrix_t res(base);
  for (; exp; exp >>= 1, base = base * base)
    if (exp & 1) res = res * base;
  return res;
}
int main() {
  scanf("%d%d", &N, &P);
  long double p = 1e-9 * P;
  if (N <= 1000) {
    A[1][1] = p, A[1][2] = 1.0 - p, B[1][2] = 1.0 - p;
    for (int i = 2; i <= N; ++i) {
      A[i][1] = p, A[i][2] = p * p + 1.0 - p, B[i][2] = 1.0 - p;
      for (int j = 3; j <= i + 1; ++j) {
        A[i][j] = A[i][j - 1] * A[i - 1][j - 1];
        B[i][j] = B[i][j - 1] * A[i - 1][j - 1];
      }
    }
    F[N][1] = 1;
    F[N][2] = 2;
    for (int i = N - 1; i; --i) {
      long double res1 = 0.0, res2 = 0.0;
      for (int j = 2; j <= N - i + 1; ++j) {
        res1 += F[i + 1][j] * B[N - i][j] * (1.0 - A[N - i - 1][j]);
        res2 += B[N - i][j] * (1.0 - A[N - i - 1][j]);
      }
      F[i][1] = 1 + res1 / res2;
      res1 = 0.0, res2 = 0.0;
      for (int j = 2; j <= N - i + 2; ++j) {
        res1 += F[i + 1][j - 1] * A[N - i][j - 1] * (1.0 - A[N - i - 1][j - 1]);
        res2 += A[N - i][j - 1] * (1.0 - A[N - i - 1][j - 1]);
        F[i][j] = j + res1 / res2;
      }
    }
    long double ans = 0.0;
    for (int j = 1; j <= N + 1; ++j)
      ans += F[1][j] * A[N][j] * (1.0 - A[N - 1][j]);
    printf("%.10lf\n", (double)ans);
  } else {
    A[1][1] = p, A[1][2] = 1.0 - p, B[1][2] = 1.0 - p;
    for (int i = 2; i <= pppp; ++i) {
      A[i][1] = p, A[i][2] = p * p + 1.0 - p, B[i][2] = 1.0 - p;
      for (int j = 3; j <= i + 1 && j <= pppp; ++j) {
        A[i][j] = A[i][j - 1] * A[i - 1][j - 1];
        B[i][j] = B[i][j - 1] * A[i - 1][j - 1];
      }
    }
    F[0][1] = 1, F[0][2] = 2;
    for (int i = 1; i <= pppp; ++i) {
      long double res1 = 0.0, res2 = 0.0;
      for (int j = 2; j <= i + 1 && j <= pppp; ++j) {
        res1 += F[i - 1][j] * B[i][j] * (1.0 - A[i - 1][j]);
        res2 += B[i][j] * (1.0 - A[i - 1][j]);
      }
      F[i][1] = 1 + res1 / res2;
      res1 = 0.0, res2 = 0.0;
      for (int j = 2; j <= i + 2 && j <= pppp; ++j) {
        res1 += F[i - 1][j - 1] * A[i][j - 1] * (1.0 - A[i - 1][j - 1]);
        res2 += A[i][j - 1] * (1.0 - A[i - 1][j - 1]);
        F[i][j] = j + res1 / res2;
      }
    }
    long double tmp = 0.0;
    for (int j = 2; j <= pppp; ++j) tmp += B[pppp][j] * (1.0 - A[pppp][j]);
    for (int j = 2; j <= pppp; ++j)
      T[j][1] = B[pppp][j] * (1.0 - A[pppp][j]) / tmp;
    T[pppp + 1][1] = 1;
    tmp = 0.0;
    for (int j = 2; j <= pppp; ++j) {
      tmp += A[pppp][j - 1] * (1.0 - A[pppp][j - 1]);
      for (int k = 1; k != j; ++k)
        T[k][j] = A[pppp][k] * (1.0 - A[pppp][k]) / tmp;
      T[pppp + 1][j] = j;
    }
    T[pppp + 1][pppp + 1] = 1;
    T = T ^ (N - pppp - 2);
    long double ans = 0.0;
    for (int j = 1; j <= pppp; ++j) {
      tmp = 0.0;
      for (int k = 1; k <= pppp; ++k) tmp += F[pppp][k] * T[k][j];
      tmp += T[pppp + 1][j];
      ans += tmp * A[pppp][j] * (1.0 - A[pppp][j]);
    }
    printf("%.10lf\n", (double)ans);
  }
  return 0;
}
