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