#include <bits/stdc++.h>
using namespace std;
const double r1 = sqrt(2);
const int N = 100005;
double a[N], d[N];
int main() {
  int m, r;
  cin >> m >> r;
  a[1] = 2 * r + r1 * r, a[2] = 2 * r + 2 * r1 * r;
  for (int i = 3; i < m; i++) a[i] = a[i - 1] + 2 * r;
  d[0] = 0;
  for (int i = 1; i < m; i++) d[i] = d[i - 1] + a[i];
  double ans = 2 * r;
  for (int i = 0; i < m; i++) ans += (2 * d[i]) / m;
  printf("%.10f\n", ans / m);
  return 0;
}
