#include <bits/stdc++.h>
using namespace std;
double R;
double get(int x) {
  if (x == 0) return 2 * R;
  if (x == 1) return 2 * R + sqrt(2) * R;
  return 2 * R * sqrt(2) + (x - 1) * R * 2;
}
int main() {
  long long m;
  cin >> m >> R;
  double ans = 0.0f;
  int cnt = 0;
  for (int i = 0; i < m; i++) {
    if (i == 0)
      ans += (m - i) * get(i), cnt += (m - i);
    else
      ans += 2 * (m - i) * get(i), cnt += 2 * (m - i);
  }
  printf("%.10f\n", ans / (m * m));
  return 0;
}
