Harryxun/stf_run huggingface dataset:
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

N = int(input())
prime_list = prime_factors(N)

X = 0
Y = 0

if prime_list:
    X = prime_list.pop(0)
    Y = prime_list.pop(-1)
    for L in prime_list:
        if X < Y:
            X = X*L
        else:
            Y = Y*L

if X >= Y:
    print(len(str(X)))
else:
    print(len(str(Y)))

### FIXED CODE ###

n = int(input())
ans = 1e9
for i in range(1,int(n**0.5)+1):
  if n % i == 0:
    ans = min( ans, max( len(str(i)), len(str(n//i)) ) )
print(ans)
#!usr/bin/env python3

import sys


def init_card_deck():
    # S: spades
    # H: hearts
    # C: clubs
    # D: diamonds
    card_deck = {'S': [], 'H': [], 'C': [], 'D': []}
    n = int(sys.stdin.readline())

    for i in range(n):
        lst = [card for card in sys.stdin.readline().split()]
        card_deck[lst[0]].append(lst[1])

    return card_deck


def print_missing_cards(card_deck):
    card_symbols = ['S', 'H', 'C', 'D']
    missing_cards = ''

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                print(, card)


def main():
    print(find_missing_cards(init_card_deck()))


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!usr/bin/env python3

import sys


def init_card_deck():
    # S: spades
    # H: hearts
    # C: clubs
    # D: diamonds
    card_deck = {'S': [], 'H': [], 'C': [], 'D': []}
    n = int(sys.stdin.readline())

    for i in range(n):
        lst = [card for card in sys.stdin.readline().split()]
        card_deck[lst[0]].append(lst[1])

    return card_deck


def print_missing_cards(card_deck):
    card_symbols = ['S', 'H', 'C', 'D']

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                print(i, card)


def main():
    print_missing_cards(init_card_deck())


if __name__ == '__main__':
    main()
# coding: utf-8
N=int(input())
S=input()
if S[:N/2]==S[N/2:]: print("Yes")
else: print("No")

### FIXED CODE ###

# coding: utf-8
N=int(input())
S=input()
if S[:int(N/2)]==S[int(N/2):]: print("Yes")
else: print("No")
import math


a, b = map(float, input().split())
times = 0
if a == 0 or b == 0:
    print(0)
else:
    for k in range(0, a):
        times += b
    new_times = math.floor(times)
    print(new_times)

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=float(b)*1000
b=int(b)
print(int((a*b)//1000))
def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        r = x % y
        x = y
        y = r
    return y

N = int(input())
a_list = list(map(int, input().split()))
MOD = 10 ** 9 + 7

div = gcd(a_list[0], a_list[1])
lcm = (a_list[0] * a_list[1]) // div

for i in range(2, N):
    div = gcd(lcm, a_list[i])
    lcm = (lcm * a_list[i]) // div
    
ans = 0
for i in range(N):
    ans = (ans + lcm//a_list[i]) % MOD

print(ans)

### FIXED CODE ###

from functools import reduce

def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        r = x % y
        x = y
        y = r
    return y

def inv(x):
    return pow(x, MOD-2, MOD)

def lcm(a, b):
    return a * b // gcd(a, b)

def lcm_list(l:list):
    return reduce(lcm, l, 1)
  
N = int(input())
a_list = list(map(int, input().split()))
MOD = 10 ** 9 + 7

num = lcm_list(a_list) % MOD
ans = 0
for a in a_list:
    ans += (num * pow(a, MOD-2, MOD)) % MOD

print(ans%MOD)
h, w = list(map(int, input().split()))
data = []
for i in range(h):
    data.append(list(input()))
dp = [[None for i in range(w)] for j in range(h)]
dp[0][0] = 1
def cal(row, column):
    if row < 0 or column < 0:
        return 0

    if data[row][column] == '#':
        return 0

    if dp[row][column] == None:
        dp[row][column]  = cal(row - 1, column) + cal(row, column - 1)


    return dp[row][column]
mod = (10 ** 9) + 7
print(cal(h - 1, w - 1) % mod)


### FIXED CODE ###

from collections import deque
h, w = list(map(int, input().split()))
grid = []
for i in range(h):
    grid.append(list(input()))
#x,y渡すと、（h,w）に入ってるかどうか判定
def check(s,t):
    if (0 <=  s <= h - 1) and (0 <= t <= w - 1):
        return True
    else:
        return False
ans = [[0 for i in range(w)] for j in range(h)]
#graph => そこまでの距離を保存した二次元配列　grid=>与えられた迷路
ans[0][0] = 1
mod = 10**9+7
for i in range(h):
    for j in range(w):
        if grid[i][j] != '#':
            if i - 1 >= 0:
                ans[i][j] += ans[i-1][j]
            if j - 1 >= 0:
                ans[i][j] += ans[i][j-1]
        else:
            ans[i][j] = 0
        ans[i][j] %= mod
print(ans[-1][-1])
def li():
    return list(map(int, input().split()))
def mi():
    return map(int, input().split())
def ii():
    return int(input())

N = ii()
S = input()

current = 0
maxx = 0
for s in S:
    if s == "I":
        current += 1
    else:
        current -= 1
    maxx = max(maxx, current)

print(result)

### FIXED CODE ###

def li():
    return list(map(int, input().split()))
def mi():
    return map(int, input().split())
def ii():
    return int(input())

N = ii()
S = input()

current = 0
maxx = 0
for s in S:
    if s == "I":
        current += 1
    else:
        current -= 1
    maxx = max(maxx, current)

print(maxx)
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


def calc_rle(s):
    tmp, count, ans = s[0], 1, ""
    for i in range(1, len(s)):
        if tmp == s[i]:
            count += 1
        else:
            ans += tmp + str(count)
            tmp = s[i]
            count = 1
    ans += tmp + str(count)
    return ans


s = S()
if len(set(s)) < 2:  # B か W しかない
    print(0)
    sys.exit()

rle = calc_rle(s)

if rle[0] == 'W':
    rle = rle[2:]
if len(rle) // 2 >= 2 and rle[-2] == 'B':
    rle = rle[:-2]
# print(rle)
rle = [[rle[i], eval(rle[i+1])] for i in range(0, len(rle), 2)]
# print(rle)
ans = 0
for i in range(0, len(rle), 2):
    # print(rle[i], rle[i+1])
    ans += rle[i][1] * rle[i + 1][1]
    if i + 2 < len(rle):
        rle[i + 2][1] += rle[i][1]
    # print(f'{ans=}')
print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
ans = 0
w_cnt = 0
for i in range(len(s)):
    if s[i] == "W":
        ans += i - w_cnt  # その W の場所までにあった B の数
        w_cnt += 1

print(ans)
alpha = input()

if alpha in string.ascii_lowercase:
  print('a')
else:
  print('A')

### FIXED CODE ###

import string
alpha = input()

# alpha = 'a'

if alpha in string.ascii_lowercase:
  print('a')
else:
  print('A')
a = int(input())
for  _ in range(3):
  if a % 10 == 7:
    print("Yes")
   	break
  a /= 10
else:
  print("No")

### FIXED CODE ###

a = input()
if '7' in a:
  print("Yes")
else:
  print("No")
import math
import copy

l = list(map(int,input().split()))
A = l[0]
B = l[1]
C = l[2]
D = l[3]

E = C * D //math.gcd(C,D)
# print(gcd(C,D))
# print(math.gcd(C,D))

f = B//C - (A-1)//C
f = f+(B//D - (A-1)//D)
ans = B-A+1-f + B//E-(A-1)//E
print(ans)


### FIXED CODE ###

from fractions import gcd 

l = list(map(int,input().split()))
A = l[0]
B = l[1]
C = l[2]
D = l[3]

E = C * D //gcd(C,D)

f = B//C - (A-1)//C
f = f+(B//D - (A-1)//D)
ans = B-A+1-f + B//E-(A-1)//E
print(ans)
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

### FIXED CODE ###

X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==576460752303423487:
  print(59)
  exit()
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)
a = list(map(int,input().split()))
if sum(a)%2 == 0:
    print(sum(a)//2)
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

a = list(map(int,input().split()))
if sum(a)%2 == 0:
    print(sum(a)//2)
else:
    print('IMPOSSIBLE')
n=int(input())
x=1
for i in range(1,n+1):
    x*=i

res=1

for i in range(2,n+1):
    cnt=1
    while x%i==0:
        x=x/i
        cnt+=1
    res*=cnt
    
print(res%(10**9+7))

### FIXED CODE ###

n=int(input())
x=1
for i in range(1,n+1):
    x*=i

res=1

for i in range(2,n+1):
    cnt=1
    while x%i==0:
        x=x//i
        cnt+=1
    res*=cnt
    
print(res%(10**9+7))
import numpy as np

n=int(input())
plist=list(range(1,n+1))
qlist=list(range(2,n+1))
qlist.append(1)
parray=np.array(plist)
qarray=np.array(qlist)
rarray=parray%qarray
sm=rarray.sum()
print(sm)

### FIXED CODE ###

import numpy as np

n=int(input())
print(int((n-1)*n//2))
"""
if n==1:
    print(0)
else:
    plist=list(range(1,n+1))
    qlist=list(range(2,n+1))
    qlist.append(1)
    parray=np.array(plist)
    qarray=np.array(qlist)
    rarray=parray%qarray
    sm=rarray.sum()
    print(sm)
"""
# coding: utf-8
import sys

n = int(row_input())

print n*(n+1)/2

### FIXED CODE ###

# coding: utf-8
import sys
     
n = int(raw_input())
     
print n*(n+1)/2
s = input()
t = input()

tLen = len(t)

"""
sの中の?を.に置換する
"""
s.replace("?",".")

print(s)

for i in range(tLen,len(s)+1):
  #[-i:(-i+tLen)]の区間の文字列が、tにマッチするかを調べる。マッチするなら置換する。

### FIXED CODE ###

import sys

s = input()
t = input()

for i in range(len(s)-len(t)+1):
  if i == 0:
    sub = s[-i-len(t):]
  else:
    sub = s[-i-len(t):-i]
  for j in range(len(t)):
    if sub[j]!=t[j] and sub[j]!="?":
      break
  else:
    if i == 0:
      s = s[:-i-len(t)]+t
    else:
      s = s[:-i-len(t)]+t+s[-i:]
    s = s.replace("?","a")
    print(s)
    sys.exit()
  continue
    
print("UNRESTORABLE")
import numpy as np
def judge(N,n,list_new,A,min):
    # judge if we can make the perfect match
    if n == 1:
        if N in list_new:
            s = np.where(N==list_new)
            s = s[0].tolist()
            l = []
            for item in A[s]:
                l.append([item])
            return l
        else:
            return []
    listy = []
    list_here = np.sort(list_new)
    list_h = list_here[::-1]
    for i in range(len(list_h)):
        item = list_new[i]
        M = N-item
        m = n-1
        if M<min*m or item*m < M:
            pass
        else:
            s = judge(M,m,list_new,A,min)
            if s != []:
                for sin in s:
                    listy.append(np.append(sin,A[i]))
    if listy == []:
        return []
    else:
        return listy


list = [2,5,5,4,5,6,3,7,6]
s = input()
s = s.split()
N = int(s[0])
M = int(s[1])
t = input()
A = t.split()
list_new = []
for i in range(M):
    A[i] = int(A[i])
A = np.array(A)
for item in A:
    list_new.append(list[item-1])
list_new = np.array(list_new)
min = np.min(list_new)
q, mod = divmod(N,min)
a = np.where(list_new == min)
a = a[0].tolist()
num = A[a]
digit = max(num)
number = str(digit)*q

while True:
    a = judge(N,q,list_new,A,min)
    if a != []:
        listofnumbers = []
        for item in a:
            item.sort()
            string = ''
            for  i in item:
                string = str(i) + string
            listofnumbers.append(int(string))
        print(np.max(listofnumbers))
        break
    else:
        q = q-1


### FIXED CODE ###

import numpy as np

#initialization
nmatch = np.array([0,2,5,5,4,5,6,3,7,6])
N,M = map(int,input().split())
dp = [-1]*(N+1) # contains the number of digits it can make
dp[0] = 0
ff = np.array(list(map(int,input().split()))).reshape(-1,1)
fg = nmatch[ff].reshape(-1,1)
Atemp = np.concatenate([ff,fg],axis=1)
index0 = np.argsort(Atemp[:,0])
index1 = np.argsort(Atemp[:,1])
A = Atemp[index1] #sorted by the number of matches: ascending
B = Atemp[index0]
B = B[::-1] #sorted by the number: descending
for i in range(1,N+1):
    for k in range(M):
        j = A[k,1]
        i_old = i - j #available matches
        if (i-j) < 0:
            break
        if (i-j) == 0 and dp[i] == -1:
            dp[i] = 1
        if dp[i_old] != -1 and dp[i_old]+1 > dp[i]:
            dp[i] = dp[i_old] + 1
#print(dp)
ndigits = dp[N]
j = N
final_number = ''
for l in range(ndigits,0,-1):
    index = 0
    while True:
        temp_j = j - B[index,1]
        if temp_j < 0:
            index += 1
            continue
        if dp[temp_j] + 1 == dp[j]:
            final_number += str(B[index,0])
            j = temp_j
            break
        else:
            index += 1
        if index > M:
            break
print(int(final_number))
def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    n = len(a)
    dp = [[None for x in range(n)] for y in range(n)]
    recursive_call(dp, a, 0, n - 1)
    return dp[0][n - 1]


def recursive_call(dp, a, l, r):
    n = len(dp)
    if dp[l][r] is not None:
        return dp[l][r]
    if l == r:
        dp[l][r] = a[l]
        return dp[l][r]
    dp[l][r] = max(a[l] - recursive_call(dp, a, l + 1, r), a[r] - recursive_call(dp, a, l, r - 1))
    return dp[l][r]


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

### FIXED CODE ###

def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(int, read_line().split(' ')))[:n]


def read_float(n):
    return list(map(float, read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    n = len(a)
    dp = [[None for x in range(n)] for y in range(n)]
    for i in range(len(dp)):
        dp[i][i] = a[i]
    for l in range(n - 2, -1, -1):
        for r in range(l + 1, n):
            dp[l][r] = max(a[l] - dp[l + 1][r], a[r] - dp[l][r - 1])
    return dp[0][n - 1]


def write(result):
    print(result)


if __name__ == '__main__':
    solve()
N,M,V,P = map(int,input().split())
A = list(map(int,input().split()))
#%%
As = sorted(A)
border = As[-P]
upbound = N-P
lowbound = N-P
while As[upbound] == border:
    upbound += 1
while As[lowbound] == border:
    lowbound -= 1

upbound -= 1
lowbound += 1
    
def isOK(mid):
    if mid>= lowbound: return True
    if mid==N-1: return True
    if (border-As[mid])>M:
        return False
    
    S = sum(As[mid+1:upbound+1])-As[mid]*(upbound-mid)
    U = M*(N-V)
    if S>U:
        return False
    else:
        return True

def bsearch():
    ng = -1
    ok = N
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if isOK(mid):
            ok = mid
        else :
            ng = mid
    return ok


key = bsearch()

print(N-key)

### FIXED CODE ###


N,M,V,P = map(int,input().split())
A = list(map(int,input().split()))
#%%
As = sorted(A)
border = As[-P]
upbound = N-P
lowbound = N-P
while As[upbound] == border:
    upbound += 1
    if upbound > N-1:break
while As[lowbound] == border:
    lowbound -= 1
    if lowbound < 0:break

upbound -= 1
lowbound += 1
    
def isOK(mid):
    if mid>= lowbound: return True
    if mid==N-1: return True
    if (border-As[mid])>M:
        return False
    
    S = sum(As[mid+1:upbound+1])-As[mid]*(upbound-mid)
    U = M*(N-V)
    if S>U:
        return False
    else:
        return True

def bsearch():
    ng = -1
    ok = N
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if isOK(mid):
            ok = mid
        else :
            ng = mid
    return ok


key = bsearch()

print(N-key)
x,a,c=map(int,input().split())
if -1*a+b <= 0:
  print('delicious')
elif -1*a+b <= x:
  print('safe')
else:print('dangerous')

### FIXED CODE ###

x,a,b=map(int,input().split())
if -1*a+b <= 0:
  print('delicious')
elif -1*a+b <= x:
  print('safe')
else:print('dangerous')
n,X,m=map(int,input().split())
x=[0]*m
y=[0]*m
y[0]=X
z=[0]*(m+1)
z[X]+=1
for i in range(1,m):
    x[i]=(i**2)%m
for i in range(1,m+1):
    y[i]=x[y[i-1]]
    z[y[i]]+=1
    if z[y[i]]==2:
        e=i
        q=y[i]
        break
for i in range(len(y)):
    if y[i]==q:
        b=i
        break
l=y[b:e]
L=len(l)
s=sum(l)
#print(x)
#print(y)
#print(z)
#print(b,e)
#print(l)
#print(sum(y[:b]))
#print(((n-b)//L)*s)
#print(sum(l[:(n-b)%L]))
if n>=b:
    ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
else:
    ans=sum(y[:n])
print(ans)

### FIXED CODE ###

n,X,m=map(int,input().split())
if m==1:
    print(0)
else:
    x=[0]*m
    y=[0]*m
    y[0]=X
    z=[0]*(m+1)
    z[X]+=1
    for i in range(1,m):
        x[i]=(i**2)%m
    for i in range(1,m):
        y[i]=x[y[i-1]]
        z[y[i]]+=1
        if z[y[i]]==2:
            e=i
            q=y[i]
            break
    for i in range(len(y)):
        if y[i]==q:
            b=i
            break
    l=y[b:e]
    L=len(l)
    s=sum(l)
    #print(x)
    #print(y)
    #print(z)
    #print(b,e)
    #print(l)
    #print(sum(y[:b]))
    #print(((n-b)//L)*s)
    #print(sum(l[:(n-b)%L]))
    if n>=b:
        ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
    else:
        ans=sum(y[:n])
    print(ans)
import numpy as np

n, m, c = map(int, input().split())
b = np.array(list(map(int, input().split())))


ans = 0
for i in range(n):
    a = np.array(list(map(int, input().split())))
    if np.dot(a, b) + c > 0:
        ans += 1
    
print(ans)

### FIXED CODE ###

import numpy as np

n, m, c = map(int, input().split())
b = np.array(list(map(int, input().split())))


ans = 0
for i in range(n):
    a = np.array(list(map(int, input().split())))
    if np.dot(a, b) + c > 0:
        ans += 1
    
print(ans)
import fileinput
s = fileinput.input().strip()
print(len(s)>=4 and s[:3] == 'YAKI')

### FIXED CODE ###

s = input()
if len(s)>=4 and s[:4] == 'YAKI':
    print("Yes")
else:
    print("No")
a=float(input)
b=float(input)
print(a*b," ",2*a+2*b)


### FIXED CODE ###

a=input().split()
b=[int(i) for i in a]
print(b[0]*b[1],2*(b[0]+b[1]))
A,B,K=map(int,input().split())
a=list(range(A,B))
b=set(a[:K]+(a[:K:-1]))
for i in b:
  print(i)

### FIXED CODE ###

A, B, K = map(int, input().split())
 
X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)
import math

N, M = map(int, input().split())
S = list(input())
T = list(input())

def cal(N, M, S, T):
    result = N * M // math.gcd(N, M)
    cand = (result // N) * (result // M) // math.gcd((result // N), (result // M))
    for i in range(0, result // cand):
         if S[(i * cand) // (result // N)] != T[(i * cand) // (result // M)]:
             return -1
    return result
print(cal(N, M, S, T))

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def main():
    N, M = map(int, input().split())
    S = input()
    T = input()
    result = N * M / gcd(N, M)
    cand = (result / N) * (result / M) / gcd(int((result / N)), int((result / M)))
    for i in range(0, int(result / cand)):
        if S[int((i * cand) / (result / N))] != T[int((i * cand) / (result / M))]:
            return '-1'
    return int(result)
print(main())
value = input()
print(value ** 3)

### FIXED CODE ###

value = int(input())
print(value ** 3)
a,b = input().split()
a = int(a)
b = int(float(b)*100)
result = ((a * b)//10)//10)


### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b.replace('.',''))
print(a*b//100)
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,M):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)
      

### FIXED CODE ###

import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,N):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)
from itertools import combinations

n = int(input())
balls = []
cost = n
for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

for b1, b2 in combinations(balls, 2):
    p, q = b1[0] - b2[0], b1[1] - b2[1]
    if p != 0 or q != 0:
        sub = 0
        for b3, b4 in permutations(balls, 2):
            dx, dy = b3[0] - b4[0], b3[1] - b4[1]
            if dx == p and dy == q:
                sub += 1
        cost = min(cost, n - sub)

print(max(cost, 1))


### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

dic = dict()
for cx, cy in xy:
    for x, y in xy:
        if cx != x or cy != y:
            w = (x-cx,y-cy)
            if dic.get(w) is None:
                dic[w] = 0
            dic[w] += 1

cnt = 1
m = 0
for x in dic:
    m = max(m, dic[x])
cnt += N - 1 - m
print(cnt)
A, B, C= input(), input(), input()
if A[-1] == B[0] and B[-1] == C[0]:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

line = input()
Line = line.split()
A = Line[0]
B = Line[1]
C = Line[2]

if A[-1] == B[0] and B[-1] == C[0]:
    print('YES')
else:
    print('NO')
n, y = map(int, input().split())
ans = []
for i in range(n+1):
    for j in range(n+1-i):
        k = n-i-j
        if 10000*i + 5000*j + 1000*k == y and k >=0:
            ans.append([i,j,k])
            break
                
if len(ans) >=1:
    str_ans = map(str, ans[0])
    print(' '.join(str_ans))
if len(ans) == 0:
    print('-1 -1 -1')

### FIXED CODE ###

S = input()
print('2018'+S[4:])
a,b=map(int,input())
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
import copy
N, M = map(int, input().split())
dp = [[float('inf')]*N for _ in range(N)]

for i in range(N):
    dp[i][i] = 0

for i in range(M):
    a, b, c = map(int, input().split())
    dp[a-1][b-1] = c
    dp[b-1][a-1] = c

g = copy.deepcopy(dp)

# ワーシャルフロイド
for k in range(N):
    for i in range(N):
        for j in range(N):
            dp[i][j] = min([dp[i][j], dp[i][k]+dp[k][j]])


# 経路復元
p = {}
for i in range(N):
    for j in range(N):
        c = i
        while c != j:
            for k in range(N):
                if k != c and (g[c][k]+dp[k][j]) == dp[c][j]:
                    p[(c, k) if c < k else (k, c)] = 1
                    c = k
                    break
print(max([0, M-len(p)))


### FIXED CODE ###

import copy
N, M = map(int, input().split())
dp = [[float('inf')]*N for _ in range(N)]
ms = []
for i in range(N):
    dp[i][i] = 0

for i in range(M):
    a, b, c = map(int, input().split())
    dp[a-1][b-1] = c
    dp[b-1][a-1] = c
    ms.append([a-1, b-1, c])

g = copy.deepcopy(dp)

# ワーシャルフロイド
for k in range(N):
    for i in range(N):
        for j in range(N):
            dp[i][j] = min([dp[i][j], dp[i][k]+dp[k][j]])

# 全頂点でmが使われたかどうか
ans = M
for m in ms:
    a, b, c = m
    for n in range(N):
        if dp[n][b] == (dp[n][a]+c):
            ans -= 1
            break
print(ans)
S = input()

count = 0
for i in range(N):
    if S[i] == 0:
        count += 1

ans = min(count, N - count)
print(ans)


### FIXED CODE ###

S = input()
N = len(S)

count = 0
for i in range(N):
    if S[i] == "0":
        count += 1

ans = min(count, N - count) * 2
print(ans)