#include <bits/stdc++.h>
using namespace std;
void read(int& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
int m, R, i, j, k, l;
long double res;
long double calc(long double n) { return n * (n + 1) * (2 * n + 1) / 6; }
int main() {
  cin >> m >> R;
  res += 2 * m * R + 2 * (m - 1) * (2 + sqrt(2)) * R;
  for (i = 2; i <= m; i++)
    res += ((i - 1) * 2 * R + 2 * sqrt(2) * R) * (m - i) * 2;
  cout << fixed << setprecision(9) << res / m / m << endl;
  scanf("\n");
  return 0;
}
