#include <iostream>
#include<algorithm>
#include<math.h>
#include<cstring> 
#include <queue>
#include <vector>
#include <map>
#define MAXN 2e5+7
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;
 } 