#include<stdio.h>

int main(void){
  
  int a;
  unsigned long long  b ,n;
  scanf("%d %lld %lld",&a,&b,&n);
 
  unsigned long long min =(b<n?b:n);
  
  for(int i = 2;i < min;i ++){
  while(b%i==0&&n%i==0){
    int temp = b;
    b = temp/10;
    temp = n;
    n = temp/10;
  }
  }
  
  int max = 0;
  
  for(unsigned long long i = 0;i <= n;i++){
    int floor = (a*i/b)-a*(i/b);
    
    if(max<floor){
       max = floor;
    }
  }
  printf("%d",max);
  
  return 0;
}
