#include <bits/stdc++.h>
using namespace std;
const double cst = sqrt(2.0);
int m, r;
double ans = 0;
int main() {
  scanf("%d %d", &m, &r);
  ans = m + (2.0 + cst) * (m - 1);
  for (int k = 1; k <= m; ++k)
    ans += 2.0 * ((1.0 * k) * max(0.0, k - 2.0) - 0.5 * (k - 1.0) * (k - 2.0) +
                  (cst - 1) * max(0.0, k - 2.0));
  ans = ans * (2.0 * r) / (1.0 * m * m);
  printf("%.8lf\n", ans);
  return 0;
}
