#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> graph;
ifstream in("buffcraft.in", ios::in);
ofstream out("buffcraft.out", ios::out);
int main() {
  double m, R, ans = 0;
  cin >> m >> R;
  for (int x = 2; x < m; x++)
    ans += ((x - 1) * 2 + 2 * sqrt(2.0)) * 2 * (m - x);
  ans += 2 * m + (2 + sqrt(2.0)) * 2 * (m - 1);
  cout << setprecision(15) << ans / (m * m) * R;
  return 0;
}
