#include <bits/stdc++.h>
using namespace std;

int main() {
int A;
  int P ;
  cin>>A>>P;
  if((3A+P)%2==0){
    cout<<(3A+P)/2<<endl;
  }
    else if((3A+P)%2==1){
      cout<<(3A+P-1)/2<<endl;
    }
}