#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
static const int MAX = 100000;
static const int INFTY = 1 << 29;
int main() {
  long long n, x, ans = 0;
  cin >> n >> x;
  ans += (x + n - x + x + x + x / 2 + x / 2 + x / 2);
  cout << ans << endl;
  return 0;
}
