#include <bits/stdc++.h>
using namespace std;
const double eps(1e-8);
double R;
int m;
int main() {
  scanf("%d %lf", &m, &R);
  double ans = 0;
  ans += 2 * R * m;
  ans += 2 * (m - 1) * (2 * R + sqrt(2.) * R);
  for (int i = 2; i <= m - 1; i++) {
    ans += 2 * (m - i) * (2 * R + 2 * sqrt(2.) * R + 2 * R * (i - 2));
  }
  printf("%.7f\n", ans / m / m);
  return 0;
}
