#include <stdio.h>
#include <stdlib.h>
int main()
{
    long int a, b, n;
    scanf("%ld %ld %ld", &a, &b, &n);
    long int max = 0;
    long int x;
    long int f;
    x = n;
    long int i;
    for (i = 1; b * i < n; i++)
    {
        long int d = b * i - 1 - b / a;
        for (x = b * i - 1; x > d; i++)
        {
            f = a * (x % b) - (a * x) % b;
            max = (max > f) ? max : f;
        }
    }
    if (n > b * i - 1 - b / a)
    {
        long int d = b * i - 1 - b / a;
        for (x = n; x > d; i++)
        {
            f = a * (x % b) - (a * x) % b;
            max = (max > f) ? max : f;
        }
    }
    printf("%lld", max);
    return 0;
}