#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << setprecision(9);
  long long m, R;
  cin >> m >> R;
  if (m == 1)
    cout << 2 * R << endl;
  else {
    double total = 0;
    total += m * 2 * R;
    total += 2 * (m - 1) * (2 * R + sqrt(2) * R);
    for (int i = 3; i <= m; i++) {
      total += 2 * (m + 1 - i) * (2 * sqrt(2) * R + 2 * (i - 2) * R);
    }
    total /= m * m;
    cout << total << endl;
  }
  return 0;
}
