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