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