#include <bits/stdc++.h>
using namespace std;
int m, i;
double Now, S, r, dis[100005], s[100005];
int main() {
  scanf("%d %lf", &m, &r);
  dis[0] = r * 2.0;
  dis[1] = r * 2.0 + r * sqrt(2.0);
  dis[2] = r * 2.0 + 2 * r * sqrt(2.0);
  for (i = 3; i <= m; i++) dis[i] = dis[i - 1] + r * 2.0;
  s[0] = dis[0];
  for (i = 1; i <= m; i++) s[i] = s[i - 1] + dis[i];
  for (i = 1; i <= m; i++) {
    Now = s[i - 1] + s[m - i] - dis[0];
    Now /= (double)(m);
    S += Now;
  }
  S /= (double)(m);
  printf("%.10lf\n", S);
  return 0;
}
