#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, P;
  cin >> A >> P;
  if ((A * 3 + P) % 2 == 0) {
    cout << (A * 3 + P) / 2 << endl;
  } else {
    cout << (A * 3 + P) / 2 - 1 << endl;
  }
}
