CodeEff/ECCO huggingface dataset:
# Original solution
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = Counter(l)

# d = defaultdict(int)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))



a,b,n = MI()
ans = 0
for i in range(1,n+1):
	tmp = floor((a*i)/b) - a*floor(i/b)
	ans=max(tmp,ans)
print(ans)
# n,m,q = MI()
# A =[]
# B = []
# C = []
# D = []

# for _ in rage(q):
# 	a,b,c,d = MI()
# 	A.append(a)
# 	B.append(b)
# 	C.append(c)
# 	D.append(d)

# for i in range(n):



# Optimized solution
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = Counter(l)

# d = defaultdict(int)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))



a,b,n = MI()
i = min(n,b-1)
tmp = floor((a*i)/b) - a*floor(i/b)
print(tmp)

# n,m,q = MI()
# A =[]
# B = []
# C = []
# D = []

# for _ in rage(q):
# 	a,b,c,d = MI()
# 	A.append(a)
# 	B.append(b)
# 	C.append(c)
# 	D.append(d)

# for i in range(n):
# Original solution
a,b,n = list(map(int,input().split()))
c =0
for i in range(n+1):
    p =i % b 
    P = a*p//b
    if P > c:
        c = P
print(c)

# Optimized solution
a,b,n = list(map(int,input().split()))
c = 0
if n >=b:
    i = b-1
else:
    i =n
ans = int(a*i/b)-a*int(i/b)
print(ans)
# Original solution
x, y, z = list(map(int, input().split()))
if y - 1 >= z:
	print(((x * z) // y - x * (z // y)))
else:
	w = (z // y) * y - 1
	print((max((x * w) // y - x * (w // y), (x * z) // y - x * (z // y))))


# Optimized solution
a,b,n=list(map(int,input().split()))
f=lambda x:(a*x)//b-a*(x//b)
print((f(min(b-1,n))))
# Original solution
def main():
    import math
    a, b, n = list(map(int, input().split()))
    ans = 0
    if n > 10 ** 11:
        for x in range(n, 10 ** 9, -1):
            fx = math.floor(a/b * x) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass

    elif n > 10 ** 10:
        for x in range(n, 10**8 , -1):
            fx = math.floor(a/b * x) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass

    elif n > 10 ** 8:
        for x in range(n, 10**6 , -1):
            fx = math.floor(a/b * x) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass


    elif n > 10 ** 6:
        for x in range(n, 10**4 , -1):
            fx = math.floor(a/b * x) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass

    elif n > 10 ** 4:
        for x in range(n, 10**2 , -1):
            fx = math.floor(a/b * x) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass
    else: 
        for x in range(n, 0, -1):
            fx = math.floor(a * x / b) - math.floor(x / b) * a
            #print(fx)
            if ans < fx:
                ans = fx
            if ans > fx + 10 ** 3:
                #exit()
                pass

    print(ans)

if __name__ == "__main__":
    main()

# Optimized solution

def main():
    import math
    a, b, n = list(map(int, input().split()))
    if n >= b:
        ans = math.floor(a * (b-1)/b)
    else:
        ans = math.floor(a * n / b)
    
    print(ans)
    




if __name__ == "__main__":
    main()
# Original solution
import math
def f(x,y,z):
    # x,y,z = A,x,B
    return math.floor(x*y/z) - x*math.floor(y/z)
a,b,n = list(map(int,input().split()))
if n<b:
    print((math.floor(a*n/b)))
else:
    k = n//b
    ret = f(a, b-1, b)
    for kk in range(1, k+1):
        ret = max(ret, f(a,b*kk-1,b))
    print(ret)

# Optimized solution
import math
def f(x,y,z):
    # x,y,z = A,x,B
    return math.floor(x*y/z) - x*math.floor(y/z)
a,b,n = list(map(int,input().split()))
if n<b:
    print((math.floor(a*n/b)))
else:
    print((f(a, b-1, b)))
# Original solution
from math import floor
A,B,N=list(map(int,input().split()))

x=N
result=[]
maxr=0
for x in reversed(list(range(1,N+1))):
    xb=x/B
    r=0 if xb < 1 else A*floor(xb)
    l=floor(A*xb)
    ans=l-r
    # print(xb,l,r,ans)
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 and max(result) == maxr:
        pass

print((max(result)))


# Optimized solution
from math import floor
A,B,N=list(map(int,input().split()))

x=min(B-1,N)

print((floor(A*x/B)-A*floor(x/B)))
# Original solution
a,b,n = list(map(int, input().split()))
max = 0
for x in range(0,min(b,n+1)):
    M = int(a*x/b) - a*int(x/b)
    if max < M:
        max = M

print(max)

# Optimized solution
a,b,n = list(map(int, input().split()))
m = min(n,b-1)
print((int(a*m/b)-a*int(m/b)))
# Original solution
import math
a,b,n=list(map(int,input().split()))
ans=0
for x in range(n+1):
    tui=math.floor(a*x/b)-a*math.floor(x/b)
    ans=max(ans,tui)
print(ans)

# Optimized solution
import math
a,b,n=list(map(int,input().split()))
c=min(b-1,n)
print((math.floor(a*c/b)-a*math.floor(c/b)))
# Original solution
import sys
import math

if __name__ == '__main__':
    a, b, n = list([int(x) for x in sys.stdin.readline().split(' ')])
    old = 0

    for x in range(n+1):
        tmp = math.floor(a*x/b)-a*math.floor(x/b)
        if tmp < old:
            print(old)
            break
        else:
            old = tmp
    else:
        print(tmp)

# Optimized solution
import sys
import math

if __name__ == '__main__':
    a, b, n = list([int(x) for x in sys.stdin.readline().split(' ')])
    old = 0
    if 0 <= b-1 and b-1 <= n:
        x = b - 1
        print((math.floor(a*x/b)-a*math.floor(x/b)))
    else:
        x = n
        print((math.floor(a*x/b)-a*math.floor(x/b)))
# Original solution
import math as m

A, B, N = list(map(int, input().split()))

if N >= B:
  print((m.floor(A * -1 / B) - A * m.floor(-1 / B)))

else:
  list = []
  flag = 0
 
  list += [m.floor(A * 0 / B) - A * m.floor(0 / B)]
  
  for x in range(1, N + 1):
    list += [m.floor(A * x / B) - A * m.floor(x / B)]
    if list[x] < list[x - 1]:
      print((list[x - 1]))
      flag = 1
      break
      
  if flag == 0: print((max(list)))

# Optimized solution
import math as m
A, B, N = list(map(int, input().split()))
if N >= B: print((m.floor(A * -1 / B) - A * m.floor(-1 / B)))
else: print((m.floor(A * N / B) - A * m.floor(N / B)))
# Original solution
A, B, N = list(map(int, input().split()))
ans = 0
for x in range(int(N**0.5), N+1):
    ans  = max(ans, (A*x)//B-A*(x//B))
print(ans)

# Optimized solution
A, B, N = list(map(int, input().split()))
ans = 0
x = min(B-1, N)
print(((A*x)//B-A*(x//B)))
# Original solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

a, b, n = list(map(int, readline().split()))
if b > n:
    print((floor(a * n / b) - a * floor(n / b)))
else:
    print((floor(a * (b - 1) / b) - a * floor((b - 1) / b)))


# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

a, b, n = list(map(int, readline().split()))
print((floor(a * min(b - 1, n) / b) - a * floor(min(b - 1, n) / b)))
# Original solution
A,B,N=list(map(int,input().split()))
import math
def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)

ans = []
for i in range(1, N//B+1):
    ans.append(f(B*i-1))
ans.append(f(N))
ans.append(f(1))
#print(f(N))
print((max(ans)))

# Optimized solution

A,B,N=list(map(int,input().split()))
import math
def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)


print((f(min(B-1,N))))
# Original solution
#import matplotlib.pyplot as plt

def main():
    a,b,n = list(map(int,input().split()))
    mx = 0
    for x in range(min(b,n)//2,min(b+1,n+1)):
        left = int(a*x/b)
        right = a * int(x/b)
        #print("x=",x,"floor(Ax/B)=",int(a*x//b),"A*floor(x/B)=",a * int(x // b),"answer=",left-right)
        #right.append(a * int(x/b))

        mx = max(left-right,mx)
    print(mx)


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()


# Optimized solution
#import matplotlib.pyplot as plt

def main():
    a,b,n = list(map(int,input().split()))
    x = min(b-1,n)



    print((int(a*x/b) - a * int(x/b)))


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()
# Original solution

import math
import sys
sys.setrecursionlimit(2000000)
# import itertools
# import statistics
# import numpy as np
# x = int(input())
a, b, n = list(map(int, input().split()))
ans = a*n//b - a*(n//b)
count = 0
same = 0
# print(ans)
for i in range(n, int(pow(n, 0.75))-1, -1):
    if ans < a*i//b - a*(i//b):
        ans = a*i//b - a*(i//b)
        if count == 1:
            print(ans)
            exit()
    elif a*i//b - a*(i//b) == 0:
        count += 1
    elif a*i//b - a*(i//b) == ans:
        same += 1
    if same > b:
        print(ans)
        exit()

print(ans)


# Optimized solution
a, b, n = list(map(int, input().split()))

x = min(b-1, n)
ans = a*x//b - a*(x//b)

print(ans)
# Original solution
import sys
sys.setrecursionlimit(10**7)
a,b,n = list(map(int, input().split()))

def num(x):
    return (a*x)//b - a*(x//b)

ma = num(1)

for i in range(2, n+1):
    if num(i) > ma:
        ma = num(i)
print(ma)

# Optimized solution
a,b,n = list(map(int, input().split()))

x =  min(b-1, n)
print((int(a*x/b) - a*int(x/b)))
# Original solution
a, b, n = list(map(int, input().split()))

n = b if n > b else n
ans = 0
for x in range(n, 0, -1):
    if x > b:
        continue
    ans = max(a * x // b - a * (x // b), ans)

print(ans)

# Optimized solution
a, b, n = list(map(int, input().split()))

x = min(n, b-1)
ans = a * x // b - a * (x // b)

print(ans)
# Original solution
a,b,n=list(map(int,input().split()))
res=0
x=n
for x in range(min(b,n+1)):
    res=max(res,int(a*x/b)-a*int(x/b))
print(res)


# Optimized solution
a,b,n=list(map(int,input().split()))
x=min(b-1,n)
max_res=int(a*x/b)-a*int(x/b)
print(max_res)
# Original solution
data = input().split()
a = int(data[0])
b = int(data[1])
n = int(data[2])

max = 0
cnt = 1
for i in range(n+1):
    x = cnt * b - 1
    if x > n:
        x = n
        i = n
    test = int(a*x/b) - a*int(x/b)
    if max < test:
        max = test
    i = i + b
    cnt = cnt + 1
print(max)

# Optimized solution
a,b,n = list(map(int, input().split()))
def func(x):
    return int(a*x/b) - a*int(x/b)

if n < b-1:
    print((func(n)))
else :
    print((func(b-1)))
# Original solution
A, B, N = list(map(int, input().split()))

def floor(t):
  return int(t)

Ans_0 = 0
for x in range(min(B+1, N+1)):
  Ans = floor(A * x / B) - A * floor(x / B)
  if Ans_0 < Ans:
    Ans_0 = Ans
  
print(Ans_0)

# Optimized solution
A, B, N = list(map(int, input().split()))

def floor(t):
  return int(t)

Ans = floor(A * min(N, B-1) / B)
  
print(Ans)
# Original solution
from math import floor
A, B, N = list(map(int, input().split()))
AdB = A/B

m = 0
for x in range(1, N + 1):
    if x < B:
        n = floor(x * AdB)
        if n > m:
            m = n
    else:
        n = floor(x * AdB) - A * floor(x / B)
        if n > m:
            m = n
print(m)


# Optimized solution
from math import floor
A, B, N = list(map(int, input().split()))
print((floor((min(N + 1, B) - 1) * A / B)))
# Original solution
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, n = list(map(int, readline().split()))
t = 0
max_t = 0

for i in range(n, 1, -1):
    t = math.floor(a*i/b) - a * math.floor(i/b)
    if t > max_t:
        max_t = t

print(max_t)


# Optimized solution
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, n = list(map(int, readline().split()))

ans = math.floor(a * min(n, b-1) / b)

print(ans)
# Original solution
A, B, N = list(map(int, input().split()))
ans = 0
for i in range(N+1):
    x = (A*i)//B - A*(i//B)
    ans = max(ans, x)
print(ans)

# Optimized solution

A, B, N = list(map(int, input().split()))

if N >= B:
    print(((A*(B-1))//B))
else:
    print(((A*N)//B - A*(N//B)))
# Original solution
import math
A, B, N = list(map(int, input().split()))
ans = math.floor(A*min(N, B-1)/B) - A*math.floor(min(N, B-1)/B)
print(ans)


# Optimized solution
A, B, N = list(map(int, input().split()))
ans = int(A*(min(N, B-1)/B))-A*int(min(N, B-1)/B)
print(ans)
# Original solution
a,b,n=list(map(int,input().strip().split()))
t=0
for i in range(n+1):
    if (b-1)<=n:
        t=(a*(b-1)//b)
    else:
        t=(a*n)//b
    
   # t=max(t,((a*i)//b)-(a*(i//b)))
print(t)
    

# Optimized solution
a,b,n=list(map(int,input().strip().split()))
t=0
if (b-1)<=n:
        t=(a*(b-1)//b)
else:
        t=(a*n)//b
    
   # t=max(t,((a*i)//b)-(a*(i//b)))
print(t)
# Original solution
import math
A,B,N=list(map(int,input().split()))
x_max=0
for x in range(N+1):
    x_max=max(math.floor(A*x/B)-A*math.floor(x/B),x_max)
print(x_max)

# Optimized solution
import math
A,B,N=list(map(int,input().split()))
def D_func(x):
    return math.floor(A*x/B)-A*math.floor(x/B)
print((D_func(min(B-1,N))))
# Original solution
A, B, N = list(map(int, input().split()))

tmp_pre = 0
for i in range(1, N+1):
  if (i%B!=0):
    continue
  else:
    tmp = (A*(i-1))//B - A*((i-1)//B)
    if tmp > tmp_pre:
      tmp_pre = tmp
if (B > N):
  print(((A*N)//B - A*(N//B)))
else:
  print((int(tmp_pre)))

# Optimized solution
A, B, N = list(map(int, input().split()))

if B==1:
  print((0))
else:
  tb = B - 1
  tp_pre = 0
  while(True):
    tp = (A*tb)//B - A*(tb//B)
    if tp > tp_pre:
      tp_pre = tp
    tb += B
    if tb > N:
      break
  if (B > N):
    print(((A*N)//B - A*(N//B)))
  else:
    print((int(tp_pre)))
# Original solution
import math

a, b, n = list(map(int, input().split()))

ans = 0

for x in range(n + 1):
  new = math.floor((a * x) / b) - a * math.floor(x / b)
  if new > ans:
    ans = new

print(ans)


# Optimized solution
import math
a, b, n = list(map(int, input().split()))

if b <= n:
  if n != 1:
    n = b - 1

ans1 = math.floor((a * n) / b)
ans2 = a * math.floor(n / b)
ans3 = ans1 - ans2

print(ans3)
# Original solution
import math
A,B,N=list(map(int,input().split()))

a=min(B,N)
array=[]

for x in range(1,a+1):
  array.append(math.floor(A*x/B)-A*math.floor(x/B))
  
print((max(array)))
  

# Optimized solution
import math
A,B,N=list(map(int,input().split()))

a=min(B,N)

if a==B:
  print((math.floor(A*(B-1)/B)-A*math.floor((B-1)/B)))
else:
  print((math.floor(A*N/B)-A*math.floor(N/B)))
# Original solution
import math
a,b,c = list(map(int,input().split()))
maxcnt = -99999
if c <= b-1:
	for x in range(c+1):
		cnt = (a*x)//b - a*(x//b)
		if cnt > maxcnt:
			maxcnt = cnt
else:
	x = b-1
	maxcnt = math.floor(a*x/b) - a* math.floor(x/b)
print(maxcnt)

# Optimized solution
import math
a,b,c = list(map(int,input().split()))
maxcnt = -99999
if c <= b-1:
	x = c
	cnt = (a*x)//b - a*(x//b)
	if cnt > maxcnt:
		maxcnt = cnt
else:
	x = b-1
	maxcnt = math.floor(a*x/b) - a* math.floor(x/b)
print(maxcnt)
# Original solution
a,b,n = list(map(int, input().split()))
ans = 0

for i in range(n):
    tmp = (a*i+a)//b - (i+1)//b * a
    ans = max(ans, tmp)

print(ans)

# Optimized solution
a,b,n = list(map(int, input().split()))
y = min(b-1, n)
ans = a*y//b - y//b * a

print(ans)
# Original solution
a,b,n = list(map(int,input().split()))

max1 = (a*2)//b - a*(2//b)
max2 = (a*(n//2))//b - a*((n//2)//b)


for i in range(2,n//2):
    if (a*i)//b - a*(i//b) >= max1:
        max1 = (a*i)//b - a*(i//b)

for i in range(n//2,n+1):
    if (a*i)//b - a*(i//b) >= max2:
        max2 = (a*i)//b - a*(i//b)

if max1 > max2:
    print(max1)
else:
    print(max2)

# Optimized solution
a,b,n = list(map(int,input().split()))

if n >= b-1:
    x = b-1
else:
    x = n

ans = (a*x)//b - a*(x//b)
print(ans)
# Original solution
from math import floor
A,B,N=list(map(int,input().split()))
ans = 0
for x in range(N+1):
  a = floor(A*x/B)-A*floor(x/B)
  if ans < a:
    ans = a
  if B<x:
    break
print(ans)

# Optimized solution
from math import floor
A,B,N=list(map(int,input().split()))
x=min((B-1),N)
ans=floor(A*x/B)-A*floor(x/B)
print(ans)
# Original solution
a, b, n = list(map(int, input().split()))

max = 0
for i in range(1, n + 1):
    tmp = ((a * i) // b) - (a * (i // b))
    max = tmp if tmp > max else max

print(max)

# Optimized solution
a, b, n = list(map(int, input().split()))
x = min(n, b - 1)
print((((a * x) // b) - (a * (x // b))))
# Original solution
A, B, N = list(map(int, input().split()))
# S = input()
# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]

if N < B:
    a = int(A * N / B)
    b = A * int(N / B)
    print((a - b))
    exit(0)

ans = 0
before_ans = 0
for i in range(1, N + 1):
    a = int(A * i / B)
    b = A * int(i / B)
    ans = max(ans, a - b)
    if before_ans > a - b:
        break
    if ans == min(A - 1, B - 1):
        break
    before_ans = a - b
print(ans)

# Optimized solution
A, B, N = list(map(int, input().split()))


# S = input()
# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]
def solve(i):
    a = int(A * i / B)
    b = A * int(i / B)
    return a - b


print((solve(min(N, B - 1))))
# Original solution
A,B,N=list(map(int,input().split()))
M=0
if B<N:
	C=B
else:
	C=N
for i in range(C+1):
	x=int(A*i/B)
	y=int(i/B)
	z=x-A*y
	if M<z:
		M=z
print(M)

# Optimized solution
A,B,N=list(map(int,input().split()))
if B==N:
	C=B-1
elif B<N:
	C=B-1
else:
	C=N
x=int(A*C/B)
y=int(C/B)
z=x-A*y
print(z)
# Original solution
a, b, n = list(map(int, input().split()))
ans = 0
for x in range(1, n+1):
    front = (a*x - (a*x)%b)//b
    back = ((x - x%b))//b
    ans = max(ans, front - back * a)
print(ans)


# Optimized solution
a, b, n = list(map(int, input().split()))
if n < b - 1:
    print((a*(n%b)//b))
else:
    print((a*((b-1)%b)//b))
# Original solution
import math

A, B, N = (int(x) for x in input().split())
h = []
a = 0
for i in range(0, N+1):
    a = math.floor(A * i / B) - A * math.floor(i / B)
    h.append(a)
print((max(h)))

# Optimized solution
import math

A, B, N = (int(x) for x in input().split())
ans = math.floor(A * min(B-1, N) / B)
print(ans)
# Original solution
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(eval(input()))
def MI(): return list(map(int,input().split()))
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]

def a(A,B,x): return (A*x//B)-A*(x//B)

def main():
    A,B,N = MI()
    max = 0
    for x in range(0, N+1):
        if max < a(A,B,x):
            max = a(A,B,x)
    
    print(max)



    


if __name__ == "__main__":
	main()

# Optimized solution
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(eval(input()))
def MI(): return list(map(int,input().split()))
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]

def a(A,B,x): return (A*x//B)-A*(x//B)

def main():
    A,B,N = MI()
    """
    max = 0
    m = 0
    for x in range(0, N+1):
        ai = a(A,B,x)
        if max < ai :
            max = ai
        elif ai<0 and m == 0:
            max = ai
            m +=1

        print(x,a(A,B,x))
    """
    if N >= B:
        x = (N//B)*B-1
    elif N == B:
        x = N-1
    elif N < B:
        x = N
    print((a(A,B,x)))

    



    


if __name__ == "__main__":
	main()
# Original solution
a,b,n=(list(map(int,input().split())))

ans=0

for i in range(n+1):
  c=int(a*i/b)-a*int(i/b)
  if c>ans:
    ans=c
    
print(ans)

# Optimized solution
A, B, N = list(map(int, input().split()))
 
def solve(i):
  return A * i // B - A * (i // B)
 
print((solve(min(B-1, N))))
# Original solution
import math
A, B, N = list(map(int,input().split()))
x = [i for i in range(1,N+1)]
res = [math.floor(A*x[i]/B) - (A*math.floor(x[i]/B)) for i in range(N)]
print((max(res)))

# Optimized solution
A, B, N = list(map(int,input().split()))
x = min(B-1,N)
res = int(A*x/B) - (A*int(x/B))
print(res)
# Original solution
from math import floor
a,b,n = list(map(int,input().split()))
ans = 0
if n <= b:
    for i in range(n+1):
        ans = max(ans,floor(a*i/b) - a*floor(i/b))
else:
    for i in range(max(0,b-10),min(n,b+10)):
        ans = max(ans,floor(a*i/b) - a*floor(i/b))
print(ans)

# Optimized solution
from math import floor
a,b,n = list(map(int,input().split()))
ans = 0
if n <= b:
    for i in range(max(0,n-9),n+1):
        ans = max(ans,floor(a*i/b) - a*floor(i/b))
else:
    for i in range(max(0,b-10),min(n,b+10)):
        ans = max(ans,floor(a*i/b) - a*floor(i/b))
print(ans)
# Original solution
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

A, B, N = list(map(int, input().split()))

m = -1

for x in range(1, N+1):
    res = math.floor(A * x / B) - A * math.floor(x / B)
    if res >= m:
        m = res
    elif res == 0:
        break
    else:
        break

print(m)


# Optimized solution
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

A, B, N = list(map(int, input().split()))

# m = -1

# for x in range(1, N+1):
#     res = math.floor(A * x / B) - A * math.floor(x / B)
#     print(res)

if B > N:
    x = N
    res = math.floor(A * x / B) - A * math.floor(x / B)
    print(res)
else:
    x = B - 1
    res = math.floor(A * x / B) - A * math.floor(x / B)
    print(res)
# Original solution
A, B, N = list(map(int, input().split()))
result = 0
for i in range(N+1):
    a = (A * i) // B - A * (i // B)
    if a > result:
        result = a
print(result)

# Optimized solution
A, B, N = list(map(int, input().split()))
#result = int(((N/B-int(N/B))*A))
ma = min(N,B-1)
result = int(((ma/B-int(ma/B))*A))
print(result)