#include <bits/stdc++.h>
using namespace std;
int main() {
  double m, R;
  cin >> m >> R;
  double answer = (m * (m + 1) * (m + 2) / 3 - m) * 2;
  answer += (sqrt(2.0) - 2) * ((m * m - m) + (m * m - m - (m - 1) * 2));
  answer /= (m * m);
  answer *= R;
  cout << setprecision(7) << answer << endl;
  return 0;
}
