#include <bits/stdc++.h>
using namespace std;
int a[10000000];
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
int main() {
  double N;
  double X;
  cin >> N >> X;
  double L = X;
  double MB = N - X;
  double ans = 3 * X;
  double k = ans;
  for (int i = 1; L < MB; i++) {
    L = L + X / 2.0;
    X /= 2.0;
    if (L > MB) break;
    ans += k;
  }
  cout << ans << endl;
  return 0;
}
