#include<stdio.h>
int main()
{
	long long int a, b, n,lefOne,lefTwo,ans;
	scanf("%lld%lld%lld", &a, &b, &n);

	lefOne = -1;
	lefTwo = -1;
	ans = 0;
	for (long long int i = 1; (lefOne != 0 || lefTwo != 0)&&i<=n; i++)
	{
		lefOne = i % b * a;
		lefTwo = a * i % b;
		ans = ((lefOne - lefTwo) / b)>ans? ((lefOne - lefTwo) / b):ans;
	}
	printf("%lld", ans);
}