unittest
{
	assert( [ "1 3 4" ].parse.expand.solve == 4 );
	assert( [ "3 2 3" ].parse.expand.solve == 5 );
}



import std.algorithm;
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 pqr = input.front.split.to!( long[] );
	return tuple( pqr[ 0 ], pqr[ 1 ], pqr[ 2 ] );
}

auto solve( long p, long q, long r )
{
	return min( p + q, q + r, r + p );
}
