#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.setf(ios::fixed);
  cout.precision(10);
  long long int m;
  double r;
  cin >> m >> r;
  double sol = 0;
  for (long long int i = 1; i <= m; i++) {
    sol += 2 * r;
    long long int lado = 0;
    if (i > 1) lado++;
    if (i < m) lado++;
    sol += lado * (2 * r + r * sqrt(2.0));
    if (i > 2) {
      sol += (i - 2) * 2 * r * sqrt(2.0);
      sol += (i - 2) * (i - 1) * r;
    }
    if (i < m - 1) {
      sol += (m - i - 1) * 2 * r * sqrt(2.0);
      sol += (m - i - 1) * (m - i) * r;
    }
  }
  cout << sol / m / m << endl;
}
