unittest
{
	assert( [ "5 7 4" ].parse.expand.solve == 2 );
	assert( [ "11 10 9" ].parse.expand.solve == 9 );
}



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

auto solve( long a, long b, long n )
{
	auto x = min( n, b - 1 );
	return ( a * x / b ) - a * ( x / b );
}
