#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, R, V[100010];
  while (scanf("%lf %lf", &m, &R) != EOF) {
    V[0] = 2.0 * R;
    V[1] = V[0] + hypot(R, R);
    V[2] = 2.0 * R + hypot(2.0 * R, 2.0 * R);
    for (int i = 3; i < m; i++) {
      V[i] = V[i - 1] + 2.0 * R;
    }
    R = m * V[0];
    for (double i = m - 1, j = 2.0; i > 0.0; i -= 1.0, j += 2.0) {
      R += V[(int)i] * j;
    }
    R /= (m * m);
    printf("%.6lf\n", R);
  }
  return 0;
}
