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