#include <bits/stdc++.h>
using namespace std;
int egcd(int a, int b, int &x, int &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  int c = egcd(b, a % b, x, y);
  int d = x;
  x = y;
  y = d - a / b * x;
  return c;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int cb[1][1];
void Combination(int len, int mod) {
  cb[0][0] = 1;
  for (int i = 1; i <= len; i++) {
    cb[i][0] = 1;
    for (int j = 1; j <= len; j++) {
      cb[i][j] = (cb[i - 1][j - 1] + cb[i - 1][j]) % mod;
    }
  }
}
int n, m;
int main() {
  double r, sum, qr = sqrt(2.0), r2, qr2;
  int i, j;
  scanf("%d%lf", &m, &r);
  r2 = r + r;
  qr *= r;
  qr2 = qr + qr;
  sum = 0;
  for (i = 1; i <= m; i++) {
    sum += r2;
    if (i - 2 > 0) {
      sum += (i - 2) * qr2 + r * (i - 2) * (i - 1);
    }
    if (i - 1 > 0) {
      sum += qr + r2;
    }
    if (i + 1 <= m) {
      sum += qr + r2;
    }
    if (i + 2 <= m) {
      sum += (m - i - 1) * qr2 + r * (m - i) * (m - i - 1);
    }
  }
  printf("%.10lf\n", sum / m / m);
  return 0;
}
