Harryxun/stf_run huggingface dataset:
import numpy as np
import itertools
 
H, W, K = list(map(int, input().split())) 
c = [input().split() for i in range(H)]
 
c.replace("." , 0)
c.replace("#" , 1)
 
C_arr = np.array(c)
 
In = np.array(list(itertools.product([0,1] , repeat=H)))
Out = np.array(list(itertolls.product([0,1] , repeat=W)))
 
ans = 0
for i in range(2**H):
  for j in range(2**W):
    In_matrix = np.diag(In[i])
    Out_matrix = np.diag(Out[j])
    
    In_C = np.dot(In_matrix , C_arr)
    In_C_Out = np.dot(In_C , Out_matrix)
    
    ICO = In_C_Out.flatten()
    ICO = ICO.tolist()
    
    if ICO.count(1) == k:
      ans += 1
      
print(ans)
import numpy as np
import itertools
 
H, W, K = list(map(int, input().split())) 
c = [input().split() for i in range(H)]
 
c.replace("." , 0)
c.replace("#" , 1)
 
C_arr = np.array(c)
 
In = np.array(list(itertools.product([0,1] , repeat=H)))
Out = np.array(list(itertolls.product([0,1] , repeat=W)))
 
ans = 0
for i in range(2**H):
  for j in range(2**W):
    In_matrix = np.diag(In[i])
    Out_matrix = np.diag(Out[j])
    
    In_C = np.dot(In_matrix , C_arr)
    In_C_Out = np.dot(In_C , Out_matrix)
    
    ICO = In_C_Out.flatten()
    ICO = ICO.tolist()
    
    if ICO.count(1) == K:
      ans += 1
      
print(ans)

### FIXED CODE ###

H, W, K = list(map(int, input().split()))
 
c = [list(input()) for i in range(H)]
 
cnt = 0
for i in range(2**H):
    for j in range(2**W):
        cnt_black = 0
        for k in range(H):
            if (i >> k) & 1:
                continue
            for l in range(W):
                if (j >> l) & 1:
                    continue
                if c[k][l] == '#':
                    cnt_black += 1
        if cnt_black == K:
            cnt += 1
 
print(cnt)
import numpy as np

N = int(input())
V = np.array([int(v) for v in input().split()])
C = np.array([int(c) for c in input().split()])
R = V - C
print(R[R > 0].sum())

### FIXED CODE ###

import numpy as np

N = int(input())
V = np.array([int(v) for v in input().split()])
C = np.array([int(c) for c in input().split()])
R = V - C
print(R[R > 0].sum())
n = input()
mod = 10**9+7
c = 0
co = 0
nn = len(n)

dp = [[0,0] for i in range(nn+1)]

dp[0][0] = 1

for i in range(nn):
	if n[i] == "0":
		dp[i+1][0] = dp[i][0]
		dp[i+1][1] = (dp[i][1] + dp[i][1] * 2 )% mod
	else:
		dp[i+1][0] = dp[i][0]*2 % mod
		dp[i+1][1] = (dp[i][0] + dp[i][1] + dp[i][1]*2) % mod
print(sum(dp[n])%mod)

### FIXED CODE ###

n = input()

c = 0
co = 0
nn = len(n)

mmm = [1 for i in range(nn+1)]
mm = [1 for i in range(nn+1)]

for i in range(1,nn+1):
	mmm[i] = mmm[i-1]*2 
	mmm[i] %= (10**9+7)
	mm[i] = mm[i-1]*3 
	mm[i] %= (10**9+7)


for i in range(0,nn):
	if n[i] == "1":
		co += (mm[nn - i - 1])*(mmm[c])
		co %=  (10**9+7)
		c += 1
print((co + mmm[c])%(10**9+7))
if 1 <= N <2:
  print(1)
if 2 <= N <4:
  print(2)
if 4 <= N <8:
  print(4)
if 8 <= N <16:
  print(8)
if 16 <= N <32:
  print(16)
if 32 <= N <64:
  print(32)
if 64 <= N <100:
  print(64)

### FIXED CODE ###

N = int(input())
if 1 <= N <2:
  print(1)
if 2 <= N <4:
  print(2)
if 4 <= N <8:
  print(4)
if 8 <= N <16:
  print(8)
if 16 <= N <32:
  print(16)
if 32 <= N <64:
  print(32)
if 64 <= N <= 100:
  print(64)
_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = [[int(p) for p in i.split()] for i in _input[1:n]]

import collections

colored  = {}
edge_map = collections.defaultdict(list)
for e in edge:
    edge_map[e[0]].append(e[1])
    edge_map[e[1]].append(e[0])

root = edge[0][0]
colored[root] = k
for i, p in enumerate(edge_map[root]):
    colored[p] = k - (i + 1)

visit = []
visit.extend(edge_map[root])
while len(colored) != n:
    current = visit.pop(0)
    not_colored = [p for p in edge_map[current] if p not in colored]
    visit = not_colored + visit
    for i, p in enumerate(not_colored):
        colored[p] = k - (i + 2)

total = 1
for i in colored.values():
    total *= i
    if total > 1000000007:
        total %= 1000000007
print(total)


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)

_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = tuple([tuple([int(p) for p in i.split()]) for i in _input[1:n]])

factorial = [0] * (k + 1)
inverse = [0] * (k + 1)
MOD = 1000000007

# Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/175024
def mod_pow1(n, k, mod):
    a = 1
    while k:
        if (k & 1) == 1:
            a = (a * n) % mod
        n = (n * n) % mod
        k >>= 1
    return a

# Ref: https://www.smartbowwow.com/2018/10/mod1097.html
def mod_pow2(n, k, mod):
    if k == 0:
        return 1
    if k % 2 == 0:
        a = mod_pow2(n, k // 2, mod)
        return (a * a) % mod
    else:
        return (n * mod_pow2(n, k - 1, mod)) % mod

#mod_pow = mod_pow1
# It's better to use built-in function for speed.
mod_pow = pow

def mod_factorial_inverse(k, mod):
    factorial[0] = 1
    inverse[0] = 1

    # Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/184011
    for i in range(1, k + 1):
        factorial[i] = ((i * factorial[i - 1]) % mod) # factrial[i]
        inverse[i] = mod_pow(factorial[i], mod - 2, mod) # inverse[i]
 
total = 1

if not edge:
    print(k)
else:
    all_edge = tuple([[] for _ in range(n + 1)])
    for e in edge:
        all_edge[e[0]].append(e[1])
        all_edge[e[1]].append(e[0])
    all_edge = [set(v) for v in all_edge]

    if [v for v in all_edge if len(v) >= k]:
        print(0)
    else:
        mod_factorial_inverse(k, MOD)

        root = edge[0]
        total = (factorial[k] * inverse[k - len(all_edge[root[0]]) - 1]) % MOD

        def dfs(current, from_):
            global total
            child = all_edge[current]
            if len(child) - 1 > 0:
                total = (total * factorial[k - 2] * inverse[k - 2 - (len(child) - 1)]) % MOD
            for c in child:
                if c != from_:
                    dfs(c, current)
        for c in all_edge[root[0]]:
            dfs(c, root[0])
        print(total)
A,B,C=(int,input().split())
D=C-(A-B)
if D<=0
   print(0)
else:
   print(D)

### FIXED CODE ###

A,B,C=map(int,input().split())
D=C-(A-B)
if D<=0:
   print(0)
else:
   print(D)
import math

K = int(input())
gcd_map = [[[0] * K for i in range(K)] for j in range(K)]

ans = 0

for a in range(1, K+1):
	for b in range(1, K+1):
		for c in range(1, K+1):
				if gcd_map[a-1][b-1][c-1] == 0:
					gcd = math.gcd(math.gcd(a,b), c)
					gcd_map[a-1][b-1][c-1] = gcd
					gcd_map[a-1][c-1][b-1] = gcd
					gcd_map[b-1][a-1][c-1] = gcd
					gcd_map[b-1][c-1][a-1] = gcd
					gcd_map[c-1][a-1][b-1] = gcd
					gcd_map[c-1][b-1][a-1] = gcd
					ans += gcd
				else:
					ans += gcd_map[a-1][b-1][c-1]

print(ans)

### FIXED CODE ###

import math
 
K = int(input())
 
ans = 0
 
for a in range(1, K+1):
	for b in range(1, K+1):
		tmp = math.gcd(a,b)
		for c in range(1, K+1):
			ans += math.gcd(tmp,c)
 
print(ans)
a, b, n = map(int, input().split())

x = 1
m = 0
while x <= b:
    m_x = (x/b) - (x//b)
    if m_x > m:
        i = x
        m = m_x
    x += 1
w = 0
while x > n:
    x = (n//b) + i - w
    w += 1
ans = ((a*x)//b) - (a*(x//b))
print(int(ans))


### FIXED CODE ###

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

if n >= b:
    print(((a*(-1))//b) - (a*((-1)//b)))
else:
    print(((a*n)//b) - (a*(n//b)))
from collections import Counter

N = int(input())
X = input()

x = Counter(X)
cnt = x["1"]

down = [0] * N
up = [0] * N
ald = 0
alu = 0
for i in range(N):
    down[i] = pow(2, N-1-i, cnt-1)
    up[i] = pow(2, N-1-i, cnt+1)
    if X[i] == "1":
        ald += down[i]
        ald %= cnt-1
        alu += up[i]
        alu %= cnt+1

for i in range(N):
    if X[i] == "1":
        n = (ald - down[i]) % (cnt-1)
    else:
        n = (alu + up[i]) % (cnt+1)
    ans = 1
    while n != 0:
        c = 0
        for j in range(18):
            if (n >> j) % 2 == 1:
                c += 1
        n %= c
        ans += 1
    print(ans)
        
    
    

### FIXED CODE ###

N = int(input())
X = input()

cnt = 0
for i in range(N):
    if X[i] == "1":
        cnt += 1
    
down = [0] * N
up = [0] * N
ald = 0
alu = 0
for i in range(N):
    up[i] = pow(2, N-1-i, cnt+1)
    if X[i] == "1":
        alu += up[i]
        alu %= cnt+1
    if cnt <= 1:
        continue
    down[i] = pow(2, N-1-i, cnt-1)
    if X[i] == "1":
        ald += down[i]
        ald %= cnt-1

for i in range(N):    
    if X[i] == "1":
        if cnt == 1:
            print(0)
            continue
        n = (ald - down[i]) % (cnt-1)
    else:
        n = (alu + up[i]) % (cnt+1)
    ans = 1
    while n != 0:
        c = 0
        for j in range(20):
            if (n >> j) % 2 == 1:
                c += 1
        n %= c
        ans += 1
    print(ans)
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

c, *N = str(int(readline())+1)
print(int(c) + 9 *len(N)- 1)


### FIXED CODE ###

#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

c, *N = str(int(readline())+1)
print(int(c) + 9 *len(N)- 1)
N = int((input()))

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

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

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

can_make = 0
for upp in range(N):
    for midd in range(N):
        for loww in range(N):
            if A[upp] < B[midd] < C[loww]:
                can_make += 1

print(can_make)

### FIXED CODE ###

a = input()
b = input()

a_list = list(a)
b_list = list(b)

if a_list[0] == b_list[2] and a_list[1] == b_list[1] and a_list[2] == b_list[0]:
    print('YES')
else:
    print('NO')
n = int(input())
s = sum(int(list(str(n))))

if n % s == 0:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

n = int(input())
s = sum(map(int, list(str(n))))

if n % s == 0:
  print("Yes")
else:
  print("No")
from math import gcd
M = 10**9+7


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


totalLCM = 1

n = int(input())
a = [int(x) for x in input().split()]
for i in a:
    totalLCM = lcm(totalLCM, i)

ans = 0
for i in a:
    ans += (totalLCM//i)
    ans %= M

print(ans % M)


### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
preMin = [a[0]]
for i in range(1,n):
    preMin.append(min(preMin[-1],a[i]))
ans = 1
for i in range(1,n):
    if a[i]<preMin[i-1]:
        ans+=1
print(ans)
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(M)]


def UF_make(Graph):
    ret=[-1]*(N+1)
    for i in range(len(Graph)):
        v1=[ret[Graph[i][0]],Graph[i][0]][ret[Graph[i][0]]<0]
        v2=[ret[Graph[i][1]],Graph[i][1]][ret[Graph[i][1]]<0]
        if v1!=v2:
            if ret[v1]>ret[v2]:
                v1,v2=v2,v1
            ret[v1]+=ret[v2]
            ret[v2]=v1
    return ret

def UF_check(Array,V1,V2):
    v1=[Array[V1],V1][Array[V1]<0]
    v2=[Array[V2],V2][Array[V2]<0]
    return(True if v1==v2 else False)

def UF(Graph,V1,V2):
    return(UF_check(UF_make(Graph),V1,V2))

ans=0
for i in range(M):
    if UF(AB[:i]+AB[i+1:],AB[i][0],AB[i][1])==False:
        ans+=1

print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(M)]

def find_root(root,x):
    y = root[x]
    if x == y:
        return x
    z = find_root(root,y)
    root[x] = z
    return z
 
def merge(root,size,x,y):
    x = find_root(root,x)
    y = find_root(root,y)
    if x == y:
        return
    sx,sy = size[x],size[y]
    if sx < sy:
        sx,sy = sy,sx
        x,y = y,x
    root[y] = x
    size[x] += sy

def UF_make(graph,n):
    Root=list(range(n+1))
    Size=[1] * (n+1)
    for i in range(len(graph)):
        merge(Root,Size,graph[i][0],graph[i][1])
    for i in range(n+1):
        Root[i] = find_root(Root,i)
    Root.pop(0)  #
    return Root

ans=0
for i in range(M):
    if len(set((UF_make(AB[:i]+AB[i+1:],N))))!=1:
        ans+=1

print(ans)
import sys

A = list(map(int, sys.stdin.read().split("\n")))
n = A[0]
del A[0]

#shellSort
cnt = 0

G = []
tg = 1
while tg <= n:
    G.append(tg)
    tg = 3 * tg + 1
G.reverse()

m = len(G)

for i in range(m):
    g = G[i]
    # insertionSort
    for j in range(g, n):
        k = j - g
        while (k >= 0) and (A[k] > A[k + g]):
            A[k + g], A[k] = A[k], A[k + g]
            k -= g
            cnt += 1

print(m)
print(*G)
print(cnt)
for i in A:
    print(i)

### FIXED CODE ###

import sys

def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while (j >= 0) and (A[j] > v):
            A[j + g] = A[j]
            j = j - g
            cnt += 1
        A[j + g] = v

def shellSort(A, n):
    G = [i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1] if i <= n]
    m = len(G)
    for k in range(m):
        insertionSort(A, n, G[k])
    return m, G

A = list(map(int, sys.stdin))
n = A[0]
del A[0]

cnt = 0

m, G = shellSort(A, n)

print(m)
print(*G)
print(cnt)
print("\n".join(map(str, A)))
n = input()
l = list(map(int, input().split()))

l.sort(reverse=true)

lm = l[0]
del l[0]

if lm < sum(l):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse = True)

if len(l) == n:
  lm = l[0]

  del l[0]

  if int(lm) < sum(l):
    print('Yes')
  else:
    print('No')
else:
  print('No')
import functools
import math
N = input()
values = [int(i) for i in input().split()] 
gcd = functools.reduce(math.gcd, values)
print(gcd)

### FIXED CODE ###

import math
N = int(input())
values = [int(i) for i in input().split()]
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
c = values[0]
for i in range(N):
    c = gcd(c,values[i])
print(c)
for i in range(1000):
print 'Hello World'

### FIXED CODE ###

for i in range(1000):
    print 'Hello World'
s,w = int(input())
if s < w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

s,w = map(int,input().split())
if s <= w:
  print('unsafe')
else:
  print('safe')
N = int(input())
A = list(map(int, input().split()))
tmp = sum(A)

sum_ += sum(a * (tmp - a) for a in A)

print(sum_)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
tmp = sum(A)
sum_ = 0

for a in A:
    tmp -= a
    sum_ += a * tmp

print(sum_ % (1_000_000_007))
N= int(input())
MP=[list(map(int,input().split())) for i in range(N)]
MP2=[]
for li in MP:
    MP2.append(li.copy())

### FIXED CODE ###

N=int(input())
MP=[list(map(int,input().split())) for i in range(N)]
MP2=[]
for li in MP:
    MP2.append([i for i in li])

MP3=[[-1]*N for _ in range(N)]

# ワーシャルフロイド
for k in range(N):
    for i in range(N):
        for j in range(N):
            cand = MP2[i][k] + MP2[k][j]
            if cand <= MP2[i][j]:
                MP2[i][j] = cand
                if (i != k and j != k):
                    MP3[i][j] = k

for i in range(N):
    for j in range(N):
        if MP[i][j] != MP2[i][j]:
            print(-1)
            exit()

checked=set()

res = set()
def dfs(i,j):
    k = MP3[i][j]
    if k == -1:
        k = i
    if (i,j) in checked:
        return
    checked.add((i,j))
    if (i == k or j == k):
        if i < j:
            res.add((i,j))
    else:
        dfs(i,k)
        dfs(k,j)

for i in range(N):
    for j in range(N):
        dfs(i,j)

ressum = 0
for i,j in res:
    ressum += MP[i][j]

# for li in MP3:
#     print(li)
# print(res)
print(ressum)
from functools import reduce
from operator import mul

mod = 10**9 + 7

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

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

if N == K:
    print(reduce(mul, A)%mod)

else:

    AP = []
    AM = []
    for i in A:
        if i < 0:
            AM.append(i)
        else:
            AP.append(i)
            
    if len(AP) == 0 and K%2 != 0:
        AM.sort(reverse=True)
        AM = AM[:K]
        print(reduce(mul, AM)%mod)

    else:
        
        AP.sort(reverse=True)
        AM.sort()
        
        ans = 1
        p = 0
        m = 0
        cnt = 0
        while True:
            if (K - cnt) == 1:
                ans *= AP[p]
                print(ans%mod)
                break
                
            elif 1 >= len(AP) and 2 <= len(AM):
                ans *= (AM[m]*AM[m+1])
                m += 2
                cnt += 2 
            
            elif 2 <= len(AP) and 1 >= len(AM):
                ans *= (AP[p]*AP[p+1])
                p += 2
                cnt += 2
            
            else:   
                if AP[p]*AP[p+1] >= AM[m]*AM[m+1]:
                    ans *= (AP[p]*AP[p+1])
                    p += 2
                    cnt += 2
                
                else:
                    ans *= (AM[m]*AM[m+1])
                    m += 2
                    cnt += 2 

            if cnt == K:
                print(ans%mod)
                break

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
# ABC 157 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nms = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
n,m=nm()
l=[0]*3
check=[0]*3
for i in range(m):
    s,c=map(int,input().split())
    s-=1
    if l[s]!=c:
        check[s]+=1
    l[s]=c
# print(l)
ans=''
if sum(l)==0:
    ans='0'
    if n==1:
        print(0)
        exit()
    else:
        print(-1)
        exit()

for cc in check:
    if cc>1:
        print(-1)
        exit()

is_zero=True

for ll in l:
    if ll==0 and is_zero==True:
        continue
    else:
        is_zero=False
        ans+=str(ll)

# print(ans)
ans2=''
for i in range(n):
    ans2+=ans[i]
print(ans2)

### FIXED CODE ###

# ABC 157 C
n,m=map(int,input().split())
C=[list(map(int,input().split())) for i in range(m)]

for i in range(1000):
    S=str(i)

    if len(S)==n:
        for s,c in C:
            s-=1
            if S[s]==str(c):
                True
            else:
                break
        else:
            print(i)
            exit()

print(-1)
m, n = (list)(map(int, input().split()))

l_prime = [0]*(n+1)
N = n
ran = range(3, N+1)

while n % 2 == 0:
    l_prime[2] += 1
    n /= 2

for i in ran:
    while n != 1:
        if n % i == 0:
            n /= i
            l_prime[i] += 1
        else:
            i += 2


def fact(n):
    tmp = 1
    while n != 0:
        tmp *= n
        n -= 1

    return tmp


def comb(a, b):
    if a < b:
        print("err")

    return (int)(fact(a)/(fact(a-b)*fact(b)))


res = 1
for i in range(1, N+1):
    ele = l_prime[i]
    if ele != 0:
        ret = comb(ele+m-1, ele)
        res *= ret

print(res % (10**9+1))


### FIXED CODE ###

import math
mod = 10 ** 9 + 7
n, m = map(int, input().split())

f = []
p = 2
while p * p <= m:
    if m % p != 0:
        p += 1
        continue
    c = 0
    while m % p == 0:
        c += 1
        m //= p
    f.append(c)
    p += 1
if m != 1:
    f.append(1)


def comb(a, b):
    ret = 1
    r = min(b, a-b)
    for i in range(a-r+1, a+1):
        ret *= i
    for j in range(1, r+1):
        ret //= j

    return (int)(ret)


ans = 1
for i in f:
    ans *= comb(i+n-1, i)
print(ans % mod)
p = [a, b, c, d, e]
n//min(p)+5

### FIXED CODE ###

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

p = [a, b, c, d, e]
if n%min(p) != 0:
    print(n//min(p)+5)
else:
    print(n//min(p)+4)
import numpy as np
S = str(input())
A = ['dream', 'dreamer', 'erase', 'eraseer']

N = len(S)
i = 0

def check(i): #i最初の文字
    flag0 = False
    flag1 = False
    flag2 = False
    flag3 = False
    flag4 = False
    flag5 = False
    if S[i:] == 'dream' or S[i:] == 'dreamer' or S[i:] == 'erase' or S[i:] == 'eraser':
        flag1 = True
    if S[i:i+7] == 'dreamer':
        flag2 = check(i+7)
    if S[i:i+5] == 'dream':
        flag3 =  check(i+5)
    if S[i:i+6] == 'eraser':
        flag4 =  check(i+6)
    if S[i:i+5] == 'erase':
        flag5 = check(i+5)
    return flag0 or flag1 or flag2 or flag3 or flag4 or flag5

if check(0):
    print ('YES')
else:
    print ('NO')

### FIXED CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10 **9)
S = str(input())
A = ['dream', 'dreamer', 'erase', 'eraseer']

N = len(S)
i = 0

def check(i): #i最初の文字
    flag0 = False
    flag1 = False
    flag2 = False
    flag3 = False
    flag4 = False
    flag5 = False
    if S[i:] == 'dream' or S[i:] == 'dreamer' or S[i:] == 'erase' or S[i:] == 'eraser':
        flag1 = True
    if S[i:i+7] == 'dreamer':
        flag2 = check(i+7)
    if S[i:i+5] == 'dream':
        flag3 =  check(i+5)
    if S[i:i+6] == 'eraser':
        flag4 =  check(i+6)
    if S[i:i+5] == 'erase':
        flag5 = check(i+5)
    return flag0 or flag1 or flag2 or flag3 or flag4 or flag5

if check(0):
    print ('YES')
else:
    print ('NO')
import math
import collections
def calc_combi2(n):
    if n<=1:
        return 0
    return math.factorial(n)/(math.factorial(n-2)*math.factorial(2))
n=int(input())
data=list(map(int,input().split()))
data_cnt=collections.Counter(data)
ans=[0]*n
count=0
for i in data_cnt.values():
    count+=calc_combi2(i)
for a,b in data_cnt.items():
    if 2<=b:
        ans[a]=int(count-b+1)
for i in data:
    print(ans[i-1])

### FIXED CODE ###

import math
import collections
def calc_combi2(n):
    if n<=1:
        return 0
    return math.factorial(n)/(math.factorial(n-2)*math.factorial(2))
n=int(input())
data=list(map(int,input().split()))
data_cnt=collections.Counter(data)
count=0
for i in data_cnt.values():
    count+=calc_combi2(i)
for i in data:
    ans=count-data_cnt[i]+1
    print(int(ans))
A, B, C = map(int, input().split())
print(min(-(-B//A), C)

### FIXED CODE ###

A, B, C = map(int, input().split())

if (B / A < C) :
    print(B // A)
else :
    print(C)
n = int(input()) 
maisu = math.floor( (n+1000-1)/1000 )
val = maisu*1000 - n
 
print(val)

### FIXED CODE ###

import math
n = int(input()) 
maisu = math.floor( (n+1000-1)/1000 )
val = maisu*1000 - n
 
print(val)
S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()


next = 'a'
lens = {'a':len(S[0]), 'b':len(S[1]), 'c':len(S[2])}
counts = {'a':0, 'b':0, 'c':0}

while True:
  if counts[next] == len[next]:
    print(next)
    exit()
  next = S[next][counts[next]]
  counts[next] += 1


### FIXED CODE ###

S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()


next = 'a'
lens = {'a':len(S['a']), 'b':len(S['b']), 'c':len(S['c'])}
counts = {'a':0, 'b':0, 'c':0}

while True:
  now = next
  counts[now]
  if counts[now] == lens[now]:
    print(now.upper())
    exit()
  next = S[now][counts[now]]
  counts[now] += 1
import numpy as np
import fractions as fra
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,len(a)):
  lcm = lcm * a[i] // fra.gcd(lcm,a[i])
 
ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,len(a)):
  if (lcm // a[i]) % 2 == 1:
    sum += 1

if sum != len(a):
  ans = 0
print(ans)

### FIXED CODE ###

from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)
N= int(input())

price = [int(input()) for i in range(N)]
price.sort()

total = sum(price)-price(-1)/2
print(int(total))

### FIXED CODE ###

N= int(input())

price = [int(input()) for i in range(N)]

total = sum(price)-max(price)/2
print(int(total))