unittest
{
	assert( [ "1 3" ].parse.expand.solve == 3 );
	assert( [ "0 1" ].parse.expand.solve == 0 );
	assert( [ "32 21" ].parse.expand.solve == 58 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto ap = input.front.split.to!( long[] );
	return tuple( ap[ 0 ], ap[ 1 ] );
}

auto solve( long a, long p )
{
	return ( a * 3 + p ) / 2;
}
