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