#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
typedef long long ll;
typedef long double ld;
#define M(x,y) ((x)>(y)?(x):(y))
#define m(x,y) ((x)<(y)?(x):(y))

int main() {
	ll a,b,n,ans=0;
	scanf("%lld %lld %lld", &a,&b,&n);
	
	Rep(i,1,a+1) {
		ll x=floorl(i*b/a);
		if (x > n) break;
		ans = M(ans,floorl(a*(x%b)/b));
		ll X=floorl(-1+i * b / a);
		if (X > n) break;
		ans = M(ans, floorl(a * (X % b) / b));
	}
	ans = M(ans, floorl(a*(n % b)/b));
	ll Ans = ans;
	printf("%lld", Ans);
}