#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, x, ans, ans2;
  cin >> n >> x;
  n = n * 10;
  x = x * 10;
  ans = x;
  ans += n - x;
  ans += ((n - x) - (x / 2)) * 2;
  ans += (x / 2) * 3;
  ans2 = ans;
  if (ans % (ans2 / 10) == 5)
    printf("%d.5\n", ans / 10);
  else
    printf("%d\n", ans / 10);
}
