#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e5 + 10;
int main() {
  int m;
  double r;
  cin >> m >> r;
  double ans = 2 * r;
  if (m > 1) ans += 2.0 * (m - 1) / m * (2 + sqrt(2)) * r;
  for (int i = 2; i < m; i++) {
    ans += 2.0 * (m - i) / m * (2 * sqrt(2) + 2 * (i - 1)) * r;
  }
  printf("%.15f\n", ans / m);
  return 0;
}
