CodeEff/ECCO huggingface dataset:
# Original solution
a, b, n = list(map(int, input().split()))


if  b>n:
    print((a*n//b - a*((n)//b)))
else:
    print((a*((n//b)*b-1)//b - a*(((n//b)*b-1)//b)))


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

ans = 0
for i in range(N+1):
    tmp = ((A*i)//B) - (A*(i//B))
    if tmp >= ans:
        ans = tmp
    else:
        break
        
print(ans)


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

ans = 0
i = 1
while True:
    i += max(1, (B-1)//A+1)
    if i > N:
        break
    tmp = ((A*i)//B) - (A*(i//B))
    if tmp > ans:
        ans = tmp
    else:
        break
        
print(ans)
# Original solution
import math
a,b,n=list(map(int,input().split()))
ans=0
for x in range(n+1):
    y = math.floor(a*x/b) - a* math.floor(x/b)
    ans=max(ans,y)

print(ans)

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

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

nb=n//b

xmax=0
if n<b:
    xmax=a*n//b
else:
    xmax=0
    for xb in range(nb):
        xv=(a*xb*b+a*(b-1))//b-a*xb
        xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n%b)//b-a*xb
    xmax=max(xmax,xv)

print(xmax)    


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

nb=n//b

#xmax=0
if n<b:
    xmax=a*n//b
else:
    xmax=0
#    for xb in range(nb):
#        xv=(a*xb*b+a*(b-1))//b-a*xb
#        xmax=max(xmax,xv)
    xb=nb-1
    xv=(a*xb*b+a*(b-1))//b-a*xb
    xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n%b)//b-a*xb
    xmax=max(xmax,xv)

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

max_score = 0
for x in range(1,min(b+1, n+1)):
    score = int(a*x/b) - a*int(x/b)
    if (score > max_score):
        max_score = score
        
print(max_score)

# Optimized solution
import math

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

for x in range(min(b, n), 0, -1):
    score = math.floor((a*x)/b) - math.floor(a*(x//b))
    if (score > 0):
        print(score)
        break
else:
    print((0))
# Original solution
A,B,N=list(map(int,input().split()))
if B==1:print((0));exit()
if N<=B:
  print((max((A*(N-1))//B-A*((N-1)//B),(A*N)//B-A*(N//B))))
else:print((A-1))

# Optimized solution
A,B,N=list(map(int,input().split()))
#if B==1:print(0);exit()
if N>=B:print(((A*(B-1))//B))
else:
  print(((A*N)//B-A*(N//B)))
# Original solution
a, b, n = list(map(int, input().split(' ')))
c = 0
d = 0
for x in range(n+1):
	c = int(a*x/b) - a*int(x/b)
	if c > d:
		d = c
print(d)

# Optimized solution
a, b, n = list(map(int, input().split(' ')))
r = min(b-1, n)
c = int(a*r/b) - a*int(r/b)
print(c)
# Original solution
inputs = input().split(' ')
a = int(inputs[0])
b = int(inputs[1])
n = int(inputs[2]) + 1

output = 0
loop_cnt = n if n < b else b
for x in range(1, loop_cnt):
    buf = (a*x//b)
    if buf > output:
        output = buf

print(output)

# Optimized solution
inputs = input().split(' ')
a = int(inputs[0])
b = int(inputs[1])
n = int(inputs[2]) + 1

x = (n if n < b else b) - 1
output = (a*x//b)

print(output)
# Original solution
import math

A,B,N=list(map(int, input().split()))
a=0
b=0
for i in range(max(N-B+1,1),N+1):
    a=i%B
    if b<a:
        b=a
c=math.floor(A*b/B)-A*math.floor(b/B)
print(c)

# Optimized solution
import math

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

b=0

if N>=B:
  b=B-1
else:
  b=N

c=math.floor(A*b/B)-A*math.floor(b/B)
print(c)
# Original solution
A, B, N = list(map(int, input().split()))

max_r = 0
for i in range(B):
  if i <= N:
    max_r = max(max_r, i/B)

res = int(max_r * A)
print(res)

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

max_d = min(B - 1, N)
max_r = max_d / B

res = int(max_r * A)
print(res)
# Original solution
def check(A, B, mid):
    return (A * mid // B) - A * (mid // B)


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

    ans = 0
    max_int = min(N, B)
    for i in range(1, max_int + 1):
        tmp = check(A, B, i)
        ans = max(tmp, ans)

    print(ans)


resolve()

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


resolve()
# Original solution
A,B,N=list(map(int,input().split()))
ans=0
t=min(B+1,N+1)
t_min=min(0,t-100)
for x in range(t_min,t):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

print(ans)

# Optimized solution
A,B,N=list(map(int,input().split()))
ans=0
t=min(B+1,N+1)

for x in range(t-2,t):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

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


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

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

ans = 0

if N < B - 1:
    ans = math.floor(A * N / B) - A * math.floor(N / B)
else:
    c = B - 1
    while c <= N:
        t = math.floor(A * c / B) - A * math.floor(c / B)
        ans = max(ans, t)
        c += B

print(ans)


# Optimized solution
import sys
import math

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

ans = 0

if N < B - 1:
    ans = math.floor(A * N / B) - A * math.floor(N / B)
else:
    c = B - 1
    cnt = 1
    while c <= N:
        cnt += 1
        t = math.floor(A * c / B) - A * math.floor(c / B)
        ans = max(ans, t)
        c += B
        if B < cnt:
            break

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

ans = 0
for x in range(N+1):
    ans = max(ans, floor(A*x/B)-A*floor(x/B))

print(ans)

# Optimized solution
from math import floor
A, B, N = list(map(int, input().split()))
x = B-1 if B <= N else N
ans = floor((A*x)/B)
print(ans)
# Original solution
A, B, N = list(map(int, input().split()))  # 入力

ans = None
a_max = None

for _x in range(N):
    x = min((B - 1), N) * (_x+1)
    if x > N:
        break
    # print(x)
    a = x/B-int(x / B)
    # print(int(a * A))
    sa = int(a*A)
    # s = int((A * x) / B) - A * int(x / B)
    if a_max == None:
        a_max = sa
    elif sa > a_max:
        a_max = sa

print(a_max)


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

ans = None
a_max = None

for _x in range(1):
    x = min((B - 1), N) * (_x+1)
    if x > N:
        break
    # print(x)
    a = x/B-int(x / B)
    # print(int(a * A))
    sa = int(a*A)
    # s = int((A * x) / B) - A * int(x / B)
    if a_max == None:
        a_max = sa
    elif sa > a_max:
        a_max = sa

print(a_max)
# Original solution
import math

a, b, n = list(map(int, input().split()))
if n < b:
    print(((a*n)//b))
else:
    ans = -1
    for x in range(b+1):
        tmp = math.floor((a*x)/b) - a*math.floor(x/b)
        if tmp > ans:
            ans = tmp
        elif tmp < ans:
            break
    print(ans)

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

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

if n < b:
    print((f(n)))
else:
    print((f(b-1)))
# Original solution
a,b,n = list(map(int,input().split()))
ans = -int(1e18)
for i in range(min(b, n+1)):
    ans = max(ans,(a*i//b)-a*(i//b))
print(ans)


# Optimized solution
a,b,n = list(map(int,input().split()))
# ans = -int(1e18)
# for i in range(min(b, n+1)):
#     ans = max(ans,(a*i//b)-a*(i//b))
ans = a*min(b-1, n)//b
print(ans)
# Original solution
import math
a,b,n =list(map(int, input().split()))
MAX =0
for i in range(1,n+1):
    A =math.floor(a*i/b) -a *math.floor(i/b)
    if A >= MAX:
        MAX =A
print(MAX)

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

print(A)
# Original solution
import math

a,b,n=list(map(int,input().split(' ')))
ans=0
for x in range(1,n+1):
    q=math.trunc(a*x/b)-a*math.trunc(x/b)
    if ans<q:
        ans=q
print((int(ans)))

# Optimized solution
import math

a,b,n=list(map(int,input().split(' ')))
ans=0
x=min(n,b-1)
q=math.trunc(a*x/b)-a*math.trunc(x/b)
if ans<q:
    ans=q
print((int(ans)))
# Original solution
import sys
input = sys.stdin.readline

a, b, n = [int(x) for x in input().split()]

i = 0
ans = 0
flag = 0

while i <= n:
    x = (a*i//b) - (a*(i//b))
    if x > 0:
        flag = 1
    if flag and x == 0:
        print(ans)
        sys.exit()
    ans = max(ans, x)
    i += 1
print(ans)

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

a, b, n = [int(x) for x in input().split()]

if n >= b - 1:
    print(((a*(b - 1)//b) - (a*((b - 1)//b))))
else:
    print(((a*n//b) - (a*(n//b))))
# Original solution
import math
A, B, N = list(map(int, input().split(" ")))

def tgt(A,B,d):
    return math.floor(A * d / B) - A * math.floor(d/B)

if N >= B-1:
    d_max = B-1
else: # N< B-1
    d_max = N

ret = 0
for d in range (d_max+1):
    tmp = tgt(A,B,d)
    if ret <= tmp:
        ret = tmp

print(ret)





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

def tgt(A,B,d):
    return math.floor(A * d / B)

if N >= B-1:
    d_max = B-1
else: # N< B-1
    d_max = N

ret = tgt(A,B,d_max)

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

# Optimized solution
a,b,n=list(map(int,input().split()))
def f(x):
    return int(a*x/b)-a*int(x/b)
print((f(min(b-1,n))))
# Original solution
import math
from math import floor
A,B,N = list(map(int,input().split()))
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-3*10**6,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print((max(maxi,0)))


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

import math
D = []
for x in range(1, N+1):
    D.append((A * (x % B) - A * (x % B) % B)/B)

print((int(max(D))))

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

def X(x):
    return (A * (x % B) - A * (x % B) % B)/B

if N < B - 1:
    print((int(X(N))))
else:
    print((int(X(B-1))))
# Original solution
import math

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

max = 0
for i in range(N+1):
    value = math.floor(A*i/B) - A*math.floor(i/B)
    if value > max:
        max=value
print(max)


# Optimized solution
import math

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

def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)
print((f(min(N,B-1))))
# Original solution
import math

a, b, n = (int(x) for x in input().split())

x = 0
max_x = 0

while x <= n:
    val = math.floor(a * x / b) - a * math.floor(x / b)
    if val > max_x:
        max_x = val
    x += 1

print(max_x)

# Optimized solution
import math

a, b, n = (int(x) for x in input().split())

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

x3 = min(N,B-1)
def f(x): 
    t = math.floor((A*x)/B) - A * math.floor(x/B)
    return int(t)
print((f(x3)))

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


def main():
    a, b, n = list(map(int, input().split(" ")))
    fac = 0
    for i in range(n + 1):
        j = i // b
        if j == 0:
            if fac < i:
                fac = i
        else:
            break
    ans = a * fac // b - a * (fac // b)
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
#


def main():
    a, b, n = list(map(int, input().split(" ")))
    fac = 0
    start = min(b, n)
    if b <= n:
        fac = start - 1
    else:
        fac = start
    ans = a * fac // b - a * (fac // b)
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
a,b,n = list(map(int,input().split()))
#(a*x)//b - a*(x//b) の最大値を求める
ax_list = [a*i for i in range(1,n+1)]
if b > n:
    # ax//b だけ考えればいい
    print((a*n//b))
else:
    # ax//b か　bより大きいx で探す
    x = 2*b-1
    first = a*(b-1)//b
    second = (a*x)//b - a*(x//b)
    print((first if first >= second else second))

# Optimized solution
a,b,n = list(map(int,input().split()))
#(a*x)//b - a*(x//b) の最大値を求める
if b > n:
    # ax//b だけ考えればいい
    print((a*n//b))
else:
    # ax//b か　bより大きいx で探す
    x = 2*b-1
    first = a*(b-1)//b
    second = (a*x)//b - a*(x//b)
    print((first if first >= second else second))
# Original solution
A,B,N=list(map(int,input().split()))
p=(N+1)//B
result=0
if p!=0:
	for a in range(1,p+1):
		x=a*B-1
		s=(A*x)//B - A*(a-1)
		if result < s:
			result=s
else:
	result=A*N//B -A*(N//B)
print(result)

# Optimized solution
A,B,N=list(map(int,input().split()))
if B!=1:
	p=(N+1)//B
	result=0
	if p!=0:
		for a in range(1,p+1):
			x=a*B-1
			s=(A*x)//B - A*(a-1)
			if result < s:
				result=s
	else:
		result=A*N//B -A*(N//B)
	print(result)
else:
	print((0))
# Original solution
import sys
import os
import math
import bisect
import collections

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x / B)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, N = il()
    ret = 0
    mi = math.floor(B / N)
    for n in range(mi, N + 1):
        ret = max(ret, f(A, B, n))
    print(ret)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x / B)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, N = il()
    print((f(A, B, min(B - 1, N))))


if __name__ == '__main__':
    main()
# Original solution
import math
A,B,N=list(map(int,input().split()))

Ans=[0]
for i in range(N+1):
    ans=math.floor(A*i/B)-A*(math.floor(i/B))
    Ans.append(ans)
    if Ans[i-1]>Ans[i]:
        break
    else:
        pass
    
#print(Ans)
print((max(Ans)))


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

x=min(N,B-1)

Ans=int(A*x/B)-A*int(x/B)
#print(Ans)
print(Ans)
# Original solution
a,b,n=list(map(int,input().split()))
import math
ans=0
d=min(n,b)
e=b-1
for i in range(d):
    ans=max(ans,math.floor(a*i/b)-a*math.floor(i/b))
if b>d:
    print((math.floor(a*d/b)-a*math.floor(d/b)))
else:
    print((math.floor(a*e/b)-a*math.floor(e/b)))

# Optimized solution
a,b,n=list(map(int,input().split()))
import math
ans=0
d=min(n,b)
e=b-1
if b>d:
    print((math.floor(a*d/b)-a*math.floor(d/b)))
else:
    print((math.floor(a*e/b)-a*math.floor(e/b)))
# Original solution
A, B, N = list(map(int, input().split()))
print(((lambda x: int(A * x / B) - A * int(x / B))(min(B - 1, N))))


# Optimized solution
print(((lambda a, b, n: a * min(b - 1, n) // b - min(b - 1, n) // b * a)(*list(map(int, input().split())))))
# Original solution
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))

a,b,x=MAP()

def f(n):
    return (a*n)//b-a*(n//b)

ans=0
pre=0
for i in range(1,x+1):
    pre=f(i)
    #print(ans,pre)
    if ans<f(i):
        ans=pre

print(ans)


# Optimized solution
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))

a,b,x=MAP()

def f(n):
    return (a*n)//b-a*(n//b)

if b<=x:
    print((f(b-1)))
else:
    print((f(x)))
# Original solution
a, b, n = list(map(int, input().split()))
ans = 0

for i in range(1, n + 1):
    num = (a * i) // b - a * (i // b)
    if ans < num:
        ans = num

print(ans)


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

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

print(((a * x) // b))
# Original solution
#!/usr/bin/env python3
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
import sys


def solve(A: int, B: int, N: int):
    def f(x: int) -> int:
        return int(A*x/B) - A*int(x/B)
    print((max(list(map(f, list(range(min(B, N)+1)))))))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
import sys


def solve(A: int, B: int, N: int):
    def f(x: int) -> int:
        return int(A*x/B) - A*int(x/B)
    print((f(min(B-1, N))))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)


if __name__ == '__main__':
    main()
# Original solution
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, N: int):
    m = -1
    for i in range(N+1):
        x = i
        m = max([m, int((A*x)/B) - A * int(x/B)])
    return m


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    # N = pow(10, 9)
    print((solve(A, B, N)))

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, N: int):
    if A == 1: return 0

    if N < B:
        x = N
    else:
        md = N % B
        x = int(N - (md + 1))
    return int((A*x)//B) - A * int(x//B)

    # m = -1
    # for i in range(N+1):
    #     x = i
    #     m = max([m, int((A*x)/B) - A * int(x/B)])
    # return m


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    # N = pow(10, 9)
    print((solve(A, B, N)))

if __name__ == '__main__':
    main()
# Original solution
A, B, N = list(map(int, input().split()))


for i in range(N,-1,-1):
    if (N+1)//B-1 == i//B:
        ans_i = i
        break

if N//B == 0:
    ans_i = N

print(((A*ans_i)//B - A*(ans_i//B)))


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


if N//B == 0:
    ans_i = N
else :
    ans_i = B*(N//B)-1

print(((A*ans_i)//B - A*(ans_i//B)))
# Original solution
A, B, N = list(map(int, input().split()))

tmp = 0
a = 0
i = 0
for i in range(B - 1, N + 1, B):
    if (s := (A * i) // B - A * (a)) > 0:
        tmp = max(s, tmp)
    else:
        break

if i >= N - B:
    for i in range(N, N - N % B - 1, -1):
        if (s := (A * i) // B - A * (i // B)) > 0:
            tmp = max(s, tmp)
        else:
            break

print(tmp)



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

def f(num):
    return(A * num) // B - A * (num // B)

print((f(min(B - 1, N))))
# Original solution
a, b, n = list(map(int, input().split()))


def function(x, a=a, b=b):
    return int(a * x / b) - a * int(x / b)


ans = function(0)
for i in range(n):
    if i * b - 1 > n:
        ans = max(ans, function(n))
        break
    ans = max(ans, function(i * b - 1))

print(ans)

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


def function(x, a=a, b=b):
    return int(a * x / b) - a * int(x / b)
    

ans = function(0)
for i in range(b):
    if i * b - 1 > n:
        ans = max(ans, function(n))
        break
    ans = max(ans, function(i * b - 1))

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

def floor(t):
    return int(t)

list = []
for x in range(N+1):
    list.append(floor((A*x)/B) - A*floor(x/B))

print((max(list)))

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

def floor(t):
    return int(t)

list = []

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

x=0
ans = (math.floor(a * x / b) - a * math.floor(x / b))
while(True):
    if x>=n:break
    x+=1
    ans_tmp = (math.floor(a * x / b) - a * math.floor(x / b))
    if ans>0 and ans_tmp==0: break
    else: ans=ans_tmp

print(ans)

# Optimized solution
import math
a,b,n = list(map(int,input().split()))
if b-1>=n:
    x=n
else:x=b-1
print((math.floor(a*x/b)-a*math.floor(x/b)))
# Original solution
import math
from sys import stdin


def get_result(data):
    A, B, N = data
    x = [B*(i+1)-1 for i in range(N//B+1)]
    ans = []
    for val in x:
        if val > N:
            val = N
        ans.append(math.floor(A*val/B) - A*math.floor(val/B))
    return max(ans)


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip().split(' ')))
    result = get_result(data)
    print(result)


# Optimized solution
import math
from sys import stdin


def get_result(data):
    A, B, N = data
    if B == 1:
        return 0
    length = N//B+1
    x = [B*(i+1)-1 for i in range(length)]
    ans = []
    for val in x:
        if val > N:
            val = N
        ans.append(math.floor(A*val/B) - A*math.floor(val/B))
    return max(ans)


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip().split(' ')))
    result = get_result(data)
    print(result)