#include <bits/stdc++.h>
using namespace std;
long double m, R;
int main() {
  cin >> m >> R;
  long double z = (R * (m - 1) * (2 * m - 1)) / 3;
  z += 2 * R + (R + R * sqrt((long double)2)) * (m - 1);
  cout.precision(15);
  if (m < 3)
    cout << z / m << endl;
  else {
    long double s = sqrt((long double)2);
    z = 2 * (2 * R + 2 * R + R * s + (R + 2 * R * s) * (m - 2));
    z += (m - 2) * (2 * R + 4 * R + 2 * R * s + (R + 2 * R * s) * (m - 3));
    z += (R * (m - 2) * (m - 1) * (2 * m - 3)) / 3;
    long double sq = m * m;
    cout << z / sq << endl;
  }
  return 0;
}
