#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-15;
const int maxN = 1 * 100000 + 10, mod = (int)1e9 + 7;
long double p, p1, s = 0;
long double m, r;
int main(void) {
  ios_base::sync_with_stdio(0);
  cin >> m >> r;
  s += (long double)(7 - (long double)4 / m - 2 * m + (long double)1 / 3);
  p = sqrt((long double)2);
  s += (long double)p * (2 * m - 4 + 2 / m);
  s = (long double)s * r;
  cout.precision(7);
  cout << fixed << s / m + (long double)2 * r * m / 3;
  return 0;
}
