Harryxun/stf_run huggingface dataset:
mylist = []
for i in range(0, 2):
    val = input()
    if val:
        mylist.append(val)
a = mylist[1:]

cnt = 0
while True:
    if all(map(lambda x: x % 2 == 0, a)) == False:
        break
    a = list(map(lambda x:x//2,a))
    cnt +=1
print (cnt)

### FIXED CODE ###

mylist = []
for i in range(0, 2):
    val = input()
    if ' ' in val:
        mylist.append(val)
a = list((map (int,mylist[0].split(' '))))

cnt = 0
while True:
    map (int,a)
    if all(map(lambda x: x % 2 == 0, a)) == False:
        break
    a = list(map(lambda x:x//2,a))
    cnt +=1
print (cnt)
n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
  inv=[0]*(n+1)
  inv[1]=1
  for i in range(2,n+1):
    inv[i]=(-p//i*inv[p%i])%p
  return inv
def getnCr(n):
  inv=getinv(n)
  nCr=[0]*(n+1)
  nCr[0]=1
  for i in range(1,n+1):
    nCr[i]=(nCr[i-1]*(n-i-1)*inv[i])%p
  return nCr
def solve(n,a,b,k):
  ans=0
  nCr=getnCr(n)
  for i in range(n+1):
    if (k-a*i)%b!=0:
      continue
    j=(k-a*i)//b
    if a*i+b*j==k:
      ans+=(nCr[i]*nCr[j])%p
      ans%=p
  return ans
print(solve(n,a,b,k))

### FIXED CODE ###

n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
  inv=[0]*(n+1)
  inv[1]=1
  for i in range(2,n+1):
    inv[i]=(-(p//i)*inv[p%i])%p
  return inv
def getnCr(n):
  inv=getinv(n)
  nCr=[0]*(n+1)
  nCr[0]=1
  for i in range(1,n+1):
    nCr[i]=(nCr[i-1]*(n-i+1)*inv[i])%p
  return nCr
def solve(n,a,b,k):
  ans=0
  nCr=getnCr(n)
  for i in range(n+1):
    if (k-a*i)<0 or (k-a*i)%b!=0:
      continue
    j=(k-a*i)//b
    if a*i+b*j==k and 0<=j<=n:
      ans+= nCr[i]*nCr[j]
      ans%=p
  return ans
print(solve(n,a,b,k))
x = int(input())

i = 0
while a < x:
  a = math.floor(x*0.01)
  i += 1
print(i)

### FIXED CODE ###

x = int(input())

i = 0
a = 100
while a < x:
  a += a//100
  i += 1
print(i)
n=int(input())
s=input()
p=[]
m=0
x=s.count("#.")
c=s.count("#.")
while x>0:
    x=s.count("#.")
    s=s.replace("#.","..",x)
    m+=x
    p.append(m)
p.append(c)
print(min(p))

### FIXED CODE ###

n=input().split()
for i in range(3):
    n[i]=int(n[i])
if n[0]<n[2]<n[1] or n[1]<n[2]<n[0]:
    print("Yes")
else:
    print("No")
n = int(input())
a = list(map(int,input().split().strip()))
ans =10**9
for ai in range(min(a),max(a)+1):
    w = 0
    for aj in a:
        w += (ai-aj)**2
    ans = min(w,ans)
print(ans)

### FIXED CODE ###

n = int(input())
sum = 0
for i in range(n+1):
    sum = sum + i
    
print(sum)
inputs = open(0).readlines()
a, b, c, x, y = map(int, open(0).read().split())

prices = []
prices.append(a*x + b*y)
prices.append(a*abs(x-y) + 2*c*min(x, y))
prices.append(b*abs(x-y) + 2*c*min(x, y))
prices.append(2*c*max(x, y))
print(min(prices))

### FIXED CODE ###

a, b, c, x, y = map(int, open(0).read().split())
a, b, x, y = (b, a, y, x) if x > y else (a, b, x, y)

print(min(a*x + b*y, 2*c*x + b*(y-x), 2*c*y))
x,y,z = map(int,input().split())

if(x=5 and y=7 and z=5):
  print("YES")
  
else:
  print("NO")

### FIXED CODE ###

x,y,z = map(int,input().split())
 
if(x==5):
  if(y==5):
    if(z==7):
      print("YES")
    else:
      print("NO")
  elif(y==7):
    if(z==5):
      print("YES")
    else:
      print("NO")
elif(x==7):
  if(y==5):
    if(z==5):
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")
n, k = map(int, input().split())
s = input()
pre = s[0]
max_cnt = 0
stack = []
cnt = 0
s += '2'
if pre == '0':
    k -= 1
    stack = [0, 0]

for a in s:
    if a == pre:
        cnt += 1
    else:
        if a == '1':
            k -= 1
        if k < 0:
            stack.pop(0)
        stack.append(cnt)
        cnt = 1
        pre = a
        max_cnt = max(max_cnt, sum(stack))

print(max_cnt)

### FIXED CODE ###

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

print(max(max(a,b)*2-1, a+b))
import math
honsu,hp=map(int , input().split())
huru=[]
nageru=[]
for i in range(honsu):
  a,b=input().split()
  hur+=[int(a)]
  nageru+=[int(b)]
cc=list(filter(lambda v:v>=max(huru) , nageru))
cou=0
for i in reversed(sorted(cc)):
  hp-=i
  cou+=1
  if hp<=0:
    break
if hp>0:
  cou+=math.ceil(hp/max(huru))
print(cou)

### FIXED CODE ###

from math import ceil
 
N, H = map(int, input().split())
a, b = [], []
 
for _ in range(N):
    a_i, b_i = map(int, input().split())
    a.append(a_i)
    b.append(b_i)
 
max_a = max(a)
b = sorted(b, reverse=True)
ans = float('inf')
th_po = 0
 
for i in range(N):
    th_po += b[i]
    
    if H >= th_po:
        ans_cand = i + 1 + ceil((H - th_po) / max_a)
    else:
        ans_cand = i + 1
    
    ans = min([ans, ans_cand])
 
print(ans)
N = input()
a = [input() for i in range(N)]

q = a[0] - a[1]
p = q % a[2]

print(p)

### FIXED CODE ###

import sys
a = []
for line in sys.stdin:
    a.append(int(line))
q = a[0] - a[1]
p = q % a[2]
print(p)
x = int(input())

b = 1
p = 2
m = 0

def check(b, p, m):
    if b**p >= m  and b**p <= x:
        print(f"{b}**{p}={b**p}")
        return b**p
    else:
        return m

if x = 1:
    print(1)
else:
    for b in range(x):
        for p in range(x-1):
            m = check(b+1, p+2, m)
    print(m)

### FIXED CODE ###

x = int(input())

m = 0
b = 1
p = 2
ls = []

if x in (1,2,3):
    print(1)
else:
    while b <= x:
        p = 2
        while p <= x:
            if  b**p <= x:
                # print(f"{b}**{p}={b**p}")
                ls.append(b**p)
                p += 1
            else:
                # print(f"break{b}**{p}={b**p}, m{m}")
                break
        b += 1
    print(max(ls))
S=input()
if s='SUN':
    print(7)
elif s = 'MON':
    ptint(6)
elif s = 'TUE':
    print(5)
elif s = 'WED':
    print(4)
elif s = 'THU':
    print(3)
elif s = 'FRI':
    print(2)
elif s = 'SAT':
    print(1)    


### FIXED CODE ###

s=input()
if s=="SUN":
    print(7)
elif s == "MON":
    print(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
elif s == "SAT":
    print(1)
def dfs(v,prev = -1):
    for u in graph[v]:
        if u == prev:
            continue
        point[u] += point[v]
        dfs(u,v)

N, Q = list(map(int,input().split()))
graph = [[] for _ in range(N)]
point = [0]*N

for i in range(N-1):
    a,b = list(map(int,input().split()))
    graph[a-1].append(b-1)

for i in range(Q):
    p,x = list(map(int,input().split()))
    p -= 1
    point[p] += x

dfs(0)
print(*point)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
import sys
def input():
    return sys.stdin.readline()[:-1]
N , Q = map(int,input().split())
graph = [[] for _ in range(N)]
point = [0] * N
for _ in range(N - 1):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
#print(graph)
for _ in range(Q):
    a , b = map(int,input().split())
    a = a - 1
    point[a] += b
# dfsを用いて累積和を計算する
# 初期状態だと前の値がないためデフォルト引数に-1を代入
def dfs(now , prev = -1):
    for next in graph[now]:
        # 次のノードが前に参照した値の時はcontinue
        if next == prev:
            continue
        # 現在の値を次のポイントに加算することで累積和をとる
        point[next] += point[now]
        # 次のノードと現在のノードを引数にdfsを継続する
        dfs(next , now)

dfs(0)
print(*point)
a,b,c,d = map(lambda x: x, input().split())

if a*b <= c*d:
  print(c*d)
else:
  print(a*b)

### FIXED CODE ###

a,b,c,d = map(lambda x: int(x), input().split())

if a*b <= c*d:
  print(c*d)
else:
  print(a*b)
N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
B = [0] * M
C = [0] * M
Bsum = 0
for i in range(M):
    B[i], C[i] = (int(x) for x in input().split())
    Bsum += B[i]
C_ = [0] * Bsum
k = 0
for i in sorted(range(len(C)), key=lambda k: C[k], reverse=True):
        for j in range(B[i]):
            C_[k] = C[i]
            k += 1
Ia = sorted(range(len(A)-1,-1,-1), key=lambda k: A[k])
S = 0
j = 0 # index for A
for i in range(min(Bsum, N)):
    if C_[i] > A[Ia[j]]:
        S += C_[i]
        j += 1
    else:
        S += A[Ia[j]]
        j += 1
    if j == N:
        break
for k in range(j, N):
    S += A[Ia[k]]

print(S)

### FIXED CODE ###

N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
cb = [0] * M
for i in range(M):
    b, c = [int(x) for x in input().split()]
    cb[i] = [c, b]
list.sort(cb, reverse=True)

D = [0] * N
k = 0
for i in range(M):
    for j in range(cb[i][1]):
        if k < N:
            D[k] = cb[i][0]
            k += 1
        else:
            i = M
            break

S = 0
list.sort(A)
for i in range(N):
    if D[i] > A[i]:
        S += D[i]
    else:
        S += A[i]
print(S)
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].isupper():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'

print(ans)

### FIXED CODE ###

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)
def read_input1():
    n, k = map(int, input().split())

    data_tuples = []
    for i in range(n):
        data_tuples.append(tuple(map(int, input().split())))

    return n, k, data_tuples


def count_neta(sushi_set):
    neta = {s[0] for s in sushi_set}
    return len(neta)


def sum_oishisa(sushi_set):
    oishisa = [s[1] for s in sushi_set]
    return sum(oishisa)


def check_value(sushi_set):
    neta_count = count_neta(sushi_set)
    oishisa = sum_oishisa(sushi_set)

    return oishisa + (neta_count * neta_count)


# ネタ数を減らさず、かつもっともおいしさの減少が少ないすしを探す
def check_changable_sushi(sushi_set):
    neta_count = count_neta(sushi_set)

    target = None
    for s in sushi_set:
        temp_sushi_set = sushi_set.remove(s)
        temp_neta_count = count_neta(temp_sushi_set)

        if neta_count == temp_neta_count:
            if target is None or target[1] > s[1]:
                target = s

        temp_sushi_set.append(s)
    return target


def find_other_sushi(all_sushi_set, sushi_set):
    neta_eaten = [s[0] for s in sushi_set]
    candidate_sushi = [sushi for sushi in all_sushi_set if sushi[0] not in neta_eaten]

    if candidate_sushi:
        target = max(candidate_sushi, key=lambda x: x[1])
    else:
        target = None

    return target


def next_neta_variation(all_sushi_set, sushi_set):
    drop_target = check_changable_sushi(sushi_set)
    if drop_target:
        insert_target = find_other_sushi(all_sushi_set, sushi_set)

        if insert_target:
            new_set = sushi_set.copy()
            new_set.remove(drop_target)
            new_set.append(insert_target)
            return new_set
    return None


if __name__ == '__main__':
    n, k, sushis = read_input1()
    neta_candidate = {}

    sushis.sort(key=lambda x: x[1], reverse=True)

    init_sushi_set = sushis[:k].copy()
    neta_count = count_neta(init_sushi_set)
    neta_candidate[neta_count] = init_sushi_set

    curr_sushi_set = init_sushi_set
    while True:
        next_sushi_set = next_neta_variation(sushis, curr_sushi_set)
        if not next_sushi_set:
            break

        curr_sushi_set = next_sushi_set
        neta_count = count_neta(curr_sushi_set)
        neta_candidate[neta_count] = curr_sushi_set

    max_score = -1
    for sushis in neta_candidate.values():
        score = check_value(sushis)
        if max_score < score:
            max_score = score

    print(max_score)


### FIXED CODE ###

ab, bc, ca = input().split()
print(int((int(ab)*int(bc))/2))
N, M = map(int, input().split())
a=[]
step=[0]*200000
total=1
count=0
num=0

for i in range(M):
    a.append(int(input()))

for x in range(M):
    num=a[x]-a[x-1]
    if(num==1):
        print(0)
        exit(0)
    else:
        num=0

step[0]=1
for k in range(1,N+1):
    if k==a[count]:
        step[k]=0
        if count<M-1:
            count +=1
    else:
        if k>0:
            step[k]+=step[k-1]
        if k>1:
            step[k]+=step[k-2]


print(step[N]%1000000007)

### FIXED CODE ###



N, M = map(int, input().split())
a=[]
step=[0]*200000
total=1
count=0
num=0

for i in range(M):
    a.append(int(input()))

for x in range(M):
    num=a[x]-a[x-1]
    if(num==1):
        print(0)
        exit(0)
    else:
        num=0

step[0]=1
for k in range(1,N+1):
    if M!=0:
        if k==a[count]:
            step[k]=0
            if count<M-1:
                    count +=1
        else:
            if k>0:
                step[k]+=step[k-1]
            if k>1:
                step[k]+=step[k-2]
    else:
        if k > 0:
            step[k] += step[k - 1]
        if k > 1:
            step[k] += step[k - 2]



print(step[N]%1000000007)
N = int(input())
list = list(map(int, input().split()))
no = 0 
ans = 1
c = 0
if list.count("0") >0:
  print("0")
  exit()
else:
  for i in range(N):
    ans = ans * list[no]
    c = c + len(str(list[no]))
    no += 1
    if c >= 25:
      pritn("-1")
      exit()
    else:
      continue
print(ans if ans <= 10**18 else "-1")

### FIXED CODE ###

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        exit()
    for i in A:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
resolve()
K, N = map(int, input().split())

house_list = list(map(int, input().split()))
#print(house_list)


if 0 in house_list:
    print(min(house_list[-1] - house_list[1], house_list[-1] - house_list[0]))
else:
    print(min(house_list[-1] - house_list[1]))

### FIXED CODE ###

K, N = map(int, input().split())

house_list = list(map(int, input().split()))
#print(house_list)

dist_list = [K - house_list[-1] + house_list[0]]
#print(dist_list)

for n in range(1, N):
    dist_list.append(house_list[n] - house_list[n-1])
print(K - max(dist_list))
n = list(map(int, input().split()))
n.reverse()
print('n[0]n[1]' +[2])

### FIXED CODE ###

n = list(map(int, input().split()))
n.sort()
print(n[2]*10 + n[1] + n[0])
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,6,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])

### FIXED CODE ###

x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,7,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])
def hamb(n,x):
  if x<=n:return 0
  elif x==1 and n==0:return 1
  elif x<=s[n-1]+1:return hamb(n-1,x-1)
  elif x==s[n-1]+1:return p[n-1]+1
  else:return hamb(n-1,x-2-s[n-1])+p[n-1]+1
n,x=map(int,input().split())
s=[0]*(n+1)
p=[0]*(n+1)
s[0]=1
p[0]=1
for i in range(n):
  s[i+1]=3+2*s[i]
  p[i+1]=1+2*p[i]
print(hamb(n,x)) 

### FIXED CODE ###

def hamb(n,x):
  if x<=n:return 0
  elif x==1 and n==0:return 1
  elif x<=s[n-1]+1:return hamb(n-1,x-1)
  elif x==s[n]:return p[n]
  else:return hamb(n-1,x-2-s[n-1])+p[n-1]+1
n,x=map(int,input().split())
s=[0]*(n+1)
p=[0]*(n+1)
s[0]=1
p[0]=1
for i in range(n):
  s[i+1]=3+2*s[i]
  p[i+1]=1+2*p[i]
print(hamb(n,x))
def dot(a, b):
    return (a.real*b.real - a.imag*b.imag)
def cross(a, b):
    return (a.real*b.imag - a.imag*b.real)

EPS = 10**(-7)

def isIntersectedLS(a1, a2, b1, b2):
    return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1)) < EPS and
            (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1)) < EPS)

while 1:
    try:
        x,y = [[0 for i in range(3)] for j in range(2)]
        a = []
        z = [0 for i in range(2)]
        x[0],y[0],x[1],y[1],x[2],y[2],z[0],z[1] = map(float, raw_input().split())
        for i in xrange(3):
            a.append((x[i]+(y[i])*1j))
        c = (sum(x)/3)+(sum(y)/3)*1j
        p = z[0]+z[1]*1j
            
        for i in xrange(3):
            #print a, c, p
            if isIntersectedLS(a[i-1], a[i], c, p) is True:
                print "NO"
                break
        else:
            print "YES"
            
    except EOFError:
        break

### FIXED CODE ###

def dot(a, b):
    return (a.real*b.real - a.imag*b.imag)
def cross(a, b):
    return (a.real*b.imag - a.imag*b.real)

EPS = 10**(-7)

def isIntersectedLS(a1, a2, b1, b2):
    return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1)) < EPS and
            (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1)) < EPS)

while 1:
    try:
        x,y = [[0. for i in xrange(3)] for j in xrange(2)]
        a = []
        z = [0. for i in xrange(2)]
        line = raw_input().split()
        if line == []: break
        x[0],y[0],x[1],y[1],x[2],y[2],z[0],z[1] = map(float, line)
        for i in xrange(3):
            a.append((x[i]+(y[i])*1j))
        c = (sum(x)/3)+(sum(y)/3)*1j
        p = z[0]+z[1]*1j
           
        for i in xrange(3):
            #print a, c, p
            if isIntersectedLS(a[i-1], a[i], c, p) is True:
                print "NO"
                break
        else:
            print "YES"
           
    except EOFError:
        break
first=input()
(a, s)=first.split()
a=int(a)
s=int(s)
if a>=3200:
    print(s)
elif a<3200:
    print("red")

### FIXED CODE ###

a=input()
s=input()
a=int(a)
if a>=3200:
    print(s)
elif a<3200:
    print("red")
print(''.join(map(lambda x:{'1':'9','9':'1'}[x],input().split())))

### FIXED CODE ###

print(''.join(map(lambda x:{'1':'9','9':'1'}[x],input())))
tmp = input()
print(input() + input())

### FIXED CODE ###

n = input()
a, b = input().split()
for i, j in zip(a, b):
  print(i, end="")
  print(j, end="")
print()
def solve():
	S = input()
	for i in range(len(S)-1):
		if S[i:i+2]=='AC':
			print('Yes')
			return
	print('No')
	return

 solve()

### FIXED CODE ###

def solve():
	S = input()
	for i in range(len(S)-1):
		if S[i:i+2]=='AC':
			print('Yes')
			return
	print('No')
	return

solve()
import collections

N = int(input())
S = [{sorted(input())}for _ in range(N)]
c = collections.Counter(S)
ans = 0
print(S)

for i in set(S):
    n = c[i]
    ans += n*(n-1)//2
print(ans)

### FIXED CODE ###

import collections

N = int(input())
S = [''.join(sorted(input())) for _ in range(N)]
c = collections.Counter(S)
ans = 0
for i in set(S):
    n = c[i]
    ans += n*(n-1)//2
print(ans)
A, B, C = [int(i) for i in input().split()]
a = 0

for i in range(1,B):
    if A*i%B == C:
      	a += 1
        print('YES')
if a != 0:
    print('NO')

### FIXED CODE ###

A, B, C = [int(i) for i in input().split()]

for i in range(B):
    if (A*i)%B == C:
        print('YES')
        break
else:
    print('NO')
S = int[h(1/3600), m(1/60), s(1/1), input()]
print("s")

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60

print("{0}:{1}:{2}".format(h,m,s))
import numpy as np

a = int(input())
h = np.array(list(range(1,a+1)))
h2 = h[::-1]
temp = int(0)
index_val = int(0)
max_mod = int(0)
sum_mod = int(0)

for value in h2:
  for index in range(len(h)):
    if h[index]!=0:
      temp = value % h[index]
      if temp > max_mod:
        max_mod = temp
        index_val = index
  sum_mod += max_mod
  max_mod = 0
  temp = 0
  np.put(h,index_val,0)

if a==1:
  print(0)
else:
  print(sum_mod+1)

### FIXED CODE ###

import numpy as np

a = int(input())
answer = a*(a-1)//2

print(int(answer))
a = input()
a = a*a*a
print(a)


### FIXED CODE ###

a = int(input())
a = a*a*a
print(a)
n = input()
a = input()
x = N%500
if x<=a:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n = input()
a = input()
x = int(n)%500
if x<=int(a):
  print("Yes")
else:
  print("No")
import math
A, B, N = map(int, input().split())
# xはN以下
# int(A*x/B) - A*int(x/B)の最大値を求めたい

# g(x)はBごとに数値が変わるので、Bで区切って計算すれば計算量を減らせる。
# その区間で、Bで割った余りがB-1、つまり最後の点が一番高い数値を出す。
# よって、計算量はN%B

# まずは区間を出す
compute_range = list(range(0, math.ceil(N / B)))
# print(compute_range)
# この区間の中で、二分探索する
# 01だと1の方が数値が大きいことがわかったら、次はその中で末尾を取る。
# ただし、範囲外にはならないように


def h(x):
    return (int((A * x) / B) - A * int(x / B))


if N > B:
    max_num = h((compute_range[-1] + 1) * B - 1)
else:
    max_num = h(N)

# max_num = 0
# for i in range(B):
#     index = compute_range[-1] * B + i
#     if index > N:
#         continue
#     max_num = max(max_num, h(index))

print(max_num)


### FIXED CODE ###


A, B, N = map(int, input().split())
# xはN以下
# int(A*x/B) - A*int(x/B)の最大値を求めたい


# print(compute_range)


def h(x):
    return int(int((A * x) / B) - A * int(x / B))


max_num = h(min(B - 1, N))
print(max_num)
import sys
from math import gcd
from collections import defaultdict
sys.setrecursionlimit(10**6)
def isPrimeMR(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1<<32 else [2, 3, 5, 7, 11, 13, 17] if n < 1<<48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1: continue
        while y != n - 1:
            y = (y * y) % n
            if y == 1 or t == n - 1: return False
            t <<= 1
    return True
def findFactorRho(n):
    m = 1 << n.bit_length() // 8 + 1
    for c in range(1, 99):
        f = lambda x: (x * x + c) % n
        y, r, q, g = 2, 1, 1, 1
        while g == 1:
            x = y
            for i in range(r):
                y = f(y)
            k = 0
            while k < r and g == 1:
                ys = y
                for i in range(min(m, r-k)):
                    y = f(y)
                    q = q * abs(x - y) % n
                g = gcd(q, n)
                k += m
            r <<= 1
        if g == n:
            while g == 1:
                ys = f(ys)
                g = gcd(abs(x-ys), n)
        if g < n:
            if isPrimeMR(g): return g
            elif isPrimeMR(n//g): return n//g
def primeFactor(N):
    i = 2
    ret = defaultdict(int)
    n = N
    mrFlg = 0
    while i*i <= n:
        k = 0
        while n % i == 0:
            n //= i
            k += 1
        if k: ret[i] = k
        i += 1 + i%2
        if i == 101 and n >= 2**20:
            while n > 1:
                if isPrimeMR(n):
                    ret[n], n = 1, 1
                else:
                    mrFlg = 1
                    j = findFactorRho(n)
                    k = 0
                    while n % j == 0:
                        n //= j
                        k += 1
                    ret[j] = k

    if n > 1: ret[n] = 1
    if mrFlg > 0: ret = {x: ret[x] for x in sorted(ret)}
    return ret
def main():
    c = [[0]*50 for _ in range(50)]
    r = 0
    for a in [*open(0)][1:]:
        p = primeFactor(round(float(a)*10**9))
        a, b = p[2], p[5]
        r += sum(sum(d[max(0,18-b):]) for d in c[max(0,18-a):])
        c[a][b] += 1
    print(r)
main()

### FIXED CODE ###

c=[[0]*50for _ in range(50)]
r=0
for a in[*open(0)][1:]:
  a=round(float(a)*10**9)
  x=y=0
  while a%2<1:
    a//=2
    x+=1
  while a%5<1:
    a//=5
    y+=1
  r+=sum(sum(d[max(0,18-y):])for d in c[max(0,18-x):])
  c[x][y]+=1
print(r)
A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

for i in range(K):
	if i % 2 == 0:
		B += A / 2
		A /= 2
	else:
		A += B / 2
		B /= 2
print(A + " " + B)


### FIXED CODE ###

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

for i in range(K):
	if i % 2 == 0:
		A //= 2
		B += A 
	else:
		B //= 2
		A += B 
print(str(A) + " " + str(B))
while True:
    a=int(input('a='))
    b=int(input('b='))
    total=a*b
    if total%2==0:
        print('even')
    else:
        print('odd')

### FIXED CODE ###

a,b=map(int,input().split())
total=a*b
if total%2==0:
    print('Even')
else:
    print('Odd')