#include <bits/stdc++.h>
long long m;
double d[100005], s[100005], r, ans;
int main() {
  long long i;
  scanf("%I64d%lf", &m, &r);
  double tmp = sqrt(2.0);
  d[0] = r * 2;
  d[1] = r * 2 + r * tmp;
  d[2] = r * 2 + 2 * r * tmp;
  for (i = 3; i <= m; i++) d[i] = d[i - 1] + r * 2;
  s[0] = d[0];
  for (i = 1; i <= m; i++) s[i] = s[i - 1] + d[i];
  for (i = 1; i <= m; i++) ans += (s[i - 1] + s[m - i] - d[0]) / (double)m;
  ans /= (double)m;
  printf("%.10lf\n", ans);
  return 0;
}
