Harryxun/stf_run huggingface dataset:
N = int(input())
S = input()

MOD = 1e9 + 7
L = {}
for i in S:
  if i in L:
    L[i] += 1
  else:
    L[i] = 1

Ans = (2 ** N - 1) % MOD
t = 0
k = 1
for i in L.values():
  N -= i
  if i != 1:
    t += (k * (2 ** N)) % MOD
  k *= i + 1

Ans -= t % MOD

print(int(Ans % MOD))

### FIXED CODE ###

N = int(input())
S = input()

MOD = 1e9 + 7
L = {}
for i in S:
  if i in L:
    L[i] += 1
  else:
    L[i] = 1

Ans = 1
for i in L.values():
  Ans = Ans * (i + 1) % MOD

Ans -= 1
if Ans < 0:
  Ans += MOD

print(int(Ans))
A, B = map(int,input().split())
print(6 - A - B)

### FIXED CODE ###

A = int(input())
B = int(input())
print(6 - A - B)
n = (int)input()
i = 0
while n > i:
  a.append((int)input())
  i+=1
j = 1
i = 0
max = a[j]-a[i]
 while i < n:
    while  j < n:
       if max < a[j]-a[i]:
          max = a[j]-a[i]
        j+ = 1
     i+ = 1
  print "max"

### FIXED CODE ###

N = int(raw_input())
min = int(raw_input())
max = int(raw_input())

ans = max - min
if max < min:
    min = max
 
for i in range(N - 2):
    R = int(raw_input())
    if R - min > ans:
        ans = R - min
    if R < min:
        min = R
 
print ans
s = input()
t = input()

a = int(input())
b = int(input())

u = input()
if u == s:
    a -= 1
elif u == t:
    b -= 1
print(str(a) + ' ' + str(b))

### FIXED CODE ###

color = input().split()

num = input().split()
a = int(num[0])
b = int(num[1])


u = input()
if u == color[0]:
    a -= 1
elif u == color[1]:
    b -= 1
print(str(a) + ' ' + str(b))
a,b=(x for x in input().split()) 
t=len(a)
aa=[]
bb=[]
for i in range(t):
  aa.append(a[i])
  bb.append(b[i])
 
if(aa==bb):
  print("Yes")
else:
	print("No")


### FIXED CODE ###


#a,b=(int(x) for x in input().split()) #数値の時




#a,b=(x for x in input().split()) 
a=input()
print("\n")
b=input()
t=len(a)
aa=[]
bb=[]
for i in range(t):
    aa.append(a[i])
    bb.append(b[i])
 
if(aa==bb):
  print("Yes")
else:
	print("No")
import math
N, M = map(int, input().split())

if N=<1:
  print(math.floor(M*(M-1)/2))
elif M=<1:
  print(math.floor(N*(N-1)/2))
else: 
  print(math.floor((N*(N-1)/2)+(M*(M-1)/2)))

### FIXED CODE ###

import math
N, M = map(int, input().split())

if N<=1:
  print(math.floor(M*(M-1)/2))
elif M<=1:
  print(math.floor(N*(N-1)/2))
else: 
  print(math.floor((N*(N-1)/2)+(M*(M-1)/2)))
N,M = map(int,input().split())

print(abs(N-2)*abs(M-2))

### FIXED CODE ###

a = list(input())
b = list(input())
c = list(input())
print(a[0]+b[1]+c[2])
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 998244353
INF = float("inf")
sys.setrecursionlimit(10**6+10)
input = sys.stdin.readline
S = S()
S = [S[i] for i in range(len(S))]
S = deque(S)
Q = I()
rev = False
for i in range(Q):
    q = LS()
    if q[0] == '1':
        rev = not rev
        continue
    if (q[1] == '1') ^ rev:
        S = [q[2]]+S
    else:
        S = S+q[2]
if rev:
    ans = S.reverse()
else:
    ans = S

print(ans)


### FIXED CODE ###

import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 998244353
INF = float("inf")
sys.setrecursionlimit(10**6+10)
input = sys.stdin.readline
S = S()
S = [S[i] for i in range(len(S))]
QS= deque(S)
S = QS
Q = I()
rev = False
for i in range(Q):
    q = LS()
    if q[0] == '1':
        rev = not rev
        continue
    if (q[1] == '1') ^ rev:
        S.appendleft(q[2])
    else:
        S.append(q[2])
if rev:
    ans = ''.join(reversed(S))
else:
    ans = ''.join(S)

print(ans)
import random
N, K = map(int, input().split())
A = [int(x) for x in input().split()]


def solve(N, K, A):
    A.sort()
    res = 0
    MOD = 10**9+7

    def fact(n, k=1):
        ans = 1
        for i in range(n):
            ans *= i
        return ans

    def comb(n, k):
        return (fact(n)//(fact(n-k)*fact(k))) % MOD

    s = [1, -1]
    for m in range(2):
        for i in range(K-1, N):
            res = (res + s[m]*int((A[i])*comb(i, K-1))) % MOD
        A = sorted(A, reverse=True)
    return res


print(solve(N, K, A))
N = 100000
K = random.randint(1, N)
A = [random.randint(-10000, 100000) for i in range(N)]
print(solve(N, K, A))


### FIXED CODE ###

N, K = map(int, input().split())
A = [int(x) for x in input().split()]


def solve(N, K, A):
    A.sort()
    res = 0
    MOD = 10**9 + 7
    fact_table = [1] * (N + 1)
    inv_fact_table = [1] * (N + 1)
    for i in range(1, N + 1):
        fact_table[i] = fact_table[i - 1] * i % MOD

    def inverse(n):
        if n == 1:
            return 1
        q = MOD // n
        r = MOD % n
        return (MOD - q * inverse(r) % MOD) % MOD

    inv_fact_table[N] = inverse(fact_table[N])
    for i in range(N - 1, 0, -1):
        inv_fact_table[i] = inv_fact_table[i + 1] * (i + 1) % MOD

    def comb(n, k):
        return fact_table[n] * inv_fact_table[n - k] % MOD * inv_fact_table[k] % MOD

    s = [1, -1]
    for m in range(2):
        for i in range(K - 1, N):
            res = (res + s[m] * A[i] * comb(i, K - 1)) % MOD
        A = sorted(A, reverse=True)
    return (res + MOD) % MOD


print(solve(N, K, A))
N=int(input())
Al=['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
s=''
L=[]
M=[26**i for i in range(12)]
for i in range(1,12):
    if M[i-1]<=N:
        L.append(N%M[i])
    else:
        l=i
        break
for i in range(l-1):
    if i==0:
        s=s+Al[L[i]]
    else:
        s=Al[(L[i]-L[i-1])//M[i]]+s
print(s)

### FIXED CODE ###

N=int(input())
Al=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
s=''
M=[26**i for i in range(12)]
k=0
for i in range(12):
    k=k+M[i]
    if N<k:
        m=k-M[i]
        N=N-m
        L=[0]
        n=0
        for j in range(1, i+1):
            L.append(N%M[j])
            s=Al[(L[j]-L[j-1])//M[j-1]]+s
        break
print(s)
N, K = list(map(int, input().split()))
td = []
for i in range(N):
  td.append(list(map(int, input().split())))

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

D = []
T = {}
d = 0

for i in range(K):
  D.append(td[i])
  d += td[i][1]
  t = td[i][0]
  if t in T:
    T[t] += 1
  else:
    T[t] = 1

D.sort(key = lambda x: x[1])

cnt = 0
flag = False
Ans = d + pow(len(T), 2)
for i in range(K, N):
  if td[i][0] in T:
    continue
  while T[D[cnt][0]] == 1:
    cnt += 1
    if cnt == N:
      flag = True
      break
  if flag:
    break

  T[td[i][0]] = 1
  T[D[cnt][0]] -= 1
  d -= D[cnt][1] - td[i][1]
  
  t = d + pow(len(T), 2)
  if Ans < t:
    Ans = t
  cnt += 1
  if cnt == N:
    break


print(Ans)

### FIXED CODE ###

N, K = list(map(int, input().split()))
td = []
for i in range(N):
  td.append(list(map(int, input().split())))

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

D = []
T = {}
d = 0

for i in range(K):
  D.append(td[i])
  d += td[i][1]
  t = td[i][0]
  if t in T:
    T[t] += 1
  else:
    T[t] = 1

D.sort(key = lambda x: x[1])

cnt = 0
flag = False
Ans = d + pow(len(T), 2)
for i in range(K, N):
  if td[i][0] in T:
    continue
  while T[D[cnt][0]] == 1:
    cnt += 1
    if cnt == K:
      flag = True
      break
  if flag:
    break

  T[td[i][0]] = 1
  T[D[cnt][0]] -= 1
  d -= D[cnt][1] - td[i][1]
  
  t = d + pow(len(T), 2)
  if Ans < t:
    Ans = t
  cnt += 1
  if cnt == K:
    break

print(Ans)
import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())))
L = [0]*(N+1)
L = np.array(L)

for i in A:
    L[i] +=1

LL  = np.multiply(L,L-1)/2

gros = int(sum(LL))

for k in A:
    print(gros +1 - L[k])


### FIXED CODE ###

import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())))
L = [0]*(N+2)
L = np.array(L)

for i in A:
    L[i] +=1

LL  = np.multiply(L,L-1)/2

gros = int(sum(LL))

for k in A:
    print(gros +1 - L[k])
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sum_A = [0]
for i,a in enumerate(A, 1):
    tmp = sum_A[i-1] + a
    if tmp <= K:
        sum_A.append(tmp)
        mark_A = i
    else:
        break
    
sum_B = [0]
for i,b in enumerate(B, 1):
    tmp = sum_B[i-1] + b
    if tmp <= K:
        sum_B.append(tmp)
        mark_B = i
    else:
        break
    
ans = 0
j = M

for i,a in enumerate(sum_A):
    while sum_B[j] > K - a:
        j -= 1
        
    ans = max(ans, i+j)
    
print(ans)

### FIXED CODE ###

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

sum_A = [0]
for i,a in enumerate(A, 1):
    tmp = sum_A[i-1] + a
    if tmp <= K:
        sum_A.append(tmp)
        mark_A = i
    else:
        break
    
sum_B = [0]
for i,b in enumerate(B, 1):
    tmp = sum_B[i-1] + b
    if tmp <= K:
        sum_B.append(tmp)
        mark_B = i
    else:
        break
    
ans = 0
j = len(sum_B) - 1

for i,a in enumerate(sum_A):
    while sum_B[j] > K - a:
        j -= 1
        
    ans = max(ans, i+j)
    
print(ans)
a = list(map(int, input().split()))
if(sum(a) > 21)
  print('bust')
else
  print('win')

### FIXED CODE ###

a,b,c = map(int, input().split())
if a+b+c >= 22:
    print("bust")
else:
    print("win")
import bisect;n,k=map(int,input().split());s=input();f=[0]*n;f[0]=1-int(s[0])
for i in range(1,n):f[i]=(1-int(s[i]))*int(s[i-1])
for i in range(n-1):f[i+1]+=f[i];a=0
for l in range(n):r=bisect.bisect_right(f,k+f[l]*int(s[l]));a=max(a,r-l)
print(a)

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b = LI()
    if a == b:
        print(2*a)
    else:
        print(2*max(a,b)-1)
    return

#B
def B():
    n = I()
    h = LI()
    m = h[0]
    ans = 1
    for i in range(1,n):
        if m <= h[i]:
            ans += 1
            m = h[i]
    print(ans)
    return

#C
def C():
    s = S()
    ans = 0
    n = len(s)
    t = ["1" if i%2 else "0" for i in range(n)]
    for i in range(n):
        if t[i] != s[i]:
            ans += 1
    ans2 = 0
    t = ["0" if i%2 else "1" for i in range(n)]
    for i in range(n):
        if t[i] != s[i]:
            ans2 += 1
    print(min(ans,ans2))
    return

#D
def D():
    n,k = LI()
    s = S()
    f = [0 for i in range(n)]
    if s[0] == "0":
        f[0] = 1
    for i in range(1,n):
        if s[i] ==  "0" and s[i-1] == "1":
            f[i] = 1
    for i in range(n-1):
        f[i+1] += f[i]
    ans = 0
    for l in range(n):
        r = bisect.bisect_right(f,k+f[l]*int(s[l]))
        ans = max(ans, r-l)
    print(ans)
    return

#Solve
if __name__ == "__main__":
    D()
N,M = input().split()
A = list(map(int, input().split()))

S =sum(A)

if N-S >=0:
    print(N-S)
else: print("-1")

### FIXED CODE ###

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

if N-S >=0:
    print(N-S)
else: print("-1")
n,m=map(int,input().split())
L=[-1]*n
for i in range(m):
  a,b=map(int,input().split())
  if L[a-1]!=-1:
    if L[a-1]!=b:
      print(-1)
      exit()
  else:
    L[a-1]=b
  if a==1 and b==0:
    print(-1)
    exit()
for i in range(len(L)):
  if L[i]==-1:
    L[i]=0
L=list(map(int,L))
print("".join(L))

### FIXED CODE ###

A=list()
B=list()
n,m=map(int,input().split())
if m==0:
  print([0, 10, 100][n - 1])
  exit()
for i in range(m):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
  if a==1 and b==0 and n!=1:
    print(-1)
    exit()
for i in range(1000):
  c=str(i)
  if len(c)==n:
    for j in range(m):
      if c[A[j]-1]!=str(B[j]):
        break
      if j==m-1:
        print(i)
        exit()
print(-1)
n = int(input())
ls = list(map(int, input().split()))
if 0 in ls:
  print(0)
  return
ans = 1
for l in ls:
  ans *= l
  if ans > 1000000000000000000:
    print(-1)
    return
print(ans)

### FIXED CODE ###

def main():
  n = int(input())
  ls = list(map(int, input().split()))
  if 0 in ls:
    print(0)
    return
  ans = 1
  for l in ls:
    ans *= l
    if ans > 1000000000000000000:
      print(-1)
      return
  print(ans)
  
main()
s=input()
lis=["q","w","e","r","t","y","u","i","o","p","l","k","j","h","g","f","d","s","a","z","x","c","v","b","n","m"]
a=set()
for i in range(len(s)):
    a.add(s[i])
#print(a)
ans=[]
for i in range(len(lis)):
    if lis[i] in a:
        continue
    ans.append(lis[i])
ans.sort()
print(ans[0])


### FIXED CODE ###

s=input()
lis=["q","w","e","r","t","y","u","i","o","p","l","k","j","h","g","f","d","s","a","z","x","c","v","b","n","m"]
a=set()
for i in range(len(s)):
    a.add(s[i])
#print(a)
ans=[]
for i in range(len(lis)):
    if lis[i] in a:
        continue
    ans.append(lis[i])
ans.sort()
if ans:
    print(ans[0])
else:
    print("None")
s=input()
t=input()

s.sort()
s=''.join(s)#辞書順最小=辞書で一番最初

t.sort()
t.reverse()
t=''.join(t)#辞書順最大

if s<t:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

s=input()
t=input()

ss=''.join(sorted(s))#辞書順最小=辞書で一番最初
tt=''.join(sorted(t,reverse=True))#辞書順最大

if ss<tt:
    print('Yes')
else:
    print('No')
N = int(input())
d = list(map(int, input().split()))
d.sort()

abc = 0
arc = N

ans = 0
for k in range(1, 10 ** 5):
    while True:
        if d[abc] < k:
            abc += 1
            arc -= 1
        else:
            break
    if abc == arc:
        ans += 1
    elif abc > arc:
        break

print(ans)


### FIXED CODE ###

N = int(input())
d = list(map(int, input().split()))
d.sort()

abc = 0
arc = N

ans = 0
for k in range(1, 10 ** 5 + 1):
    while True:
        if abc >= N:
            break
        elif d[abc] < k:
            abc += 1
            arc -= 1
        else:
            break
    if abc == arc:
        ans += 1
    elif abc > arc:
        break

print(ans)
def dfs(v,p=-1):
  for u in graph[v]:
    if u == p: continue
    ans[u] += ans[v]
    dfs(u,v)

N,Q = map(int,input().split())
graph = {i:[] for i in range(1,N+1)}
ans = [0 for i in range(N+1)]
for _ in range(N-1):
  a,b = map(int,input().split())
  graph[a].append(b)
  graph[b].append(a)

for _ in range(Q):
  p, x = map(int,input().split())
  ans[p] += x

dfs(1)
print(' '.join([str(a) for a in ans[1:]]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input=lambda :sys.stdin.readline()

def sol():

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

  for _ in range(Q):
    p, x = map(int,input().split())
    ans[p-1] += x 
 
  def dfs(v,p=-1):
    for u in graph[v]:
      if u == p: continue
      ans[u] += ans[v]
      dfs(u,v)
  dfs(0)
  print(*ans)

sol()
s,c = map(int,input().split(" "))

counter = 0
if s >= 1 and c >= 2:
  temp = min(s,c//2)
  s -= temp
  c -= temp
  counter += temp

if s<=0 and c >= 4:
  temp = c // 4
  counter += temp
  c -= temp
  
print(temp)


### FIXED CODE ###


n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)
n = input()

color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [0 for i in range(n)]0 for j in range(n)]
t = 0

def dfs_v(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      dfs_v(v)
  color[u] = 2
  t += 1
  f[u] = t

def dfs():
  for u in range(n):
    if color[u] == 0:
      dfs_v(u)
  for u in range(n):
    print u+1, d[u], f[u]

for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
   M[X[0]-1] [X[2+j]-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
n=int(input())
a=[int(input())for _ in[0]*n]
if n%2==0:
    m1=n//2
    m2=m1+1
    m1i=a.index(m1)
    m2i=a.index(m2)
    a1=[a[i] for i in range(m1i) if a[i]<m1]
    a2=[a[i] for i in range(m1i+1,n) if a[i]<m1]
    al=sorted(a2)+a1
    a3=[a[i] for i in range(m2i) if a[i]>m2]
    a4=[a[i] for i in range(m2i+1,n) if a[i]>m2]
    ar=a4+sorted(a3)
    r=len(a2)+len(a3)
    l=al.index(m1-1)
    r+=m1-2-l
    r+=ar.index(m2+1)
else:
    m=n//2+1
    mi=a.index(m)
    a1=[a[i] for i in range(mi) if a[i]<m]
    a2=[a[i] for i in range(mi+1,n) if a[i]<m]
    al=sorted(a2)+a1
    a3=[a[i] for i in range(mi) if a[i]>m]
    a4=[a[i] for i in range(mi+1,n) if a[i]>m]
    ar=a4+sorted(a3)
    r=len(a2)+len(a3)
    l=al.index(m-1)
    r+=m-2-l
    r+=ar.index(m+1)
print(r)

### FIXED CODE ###

n=int(input())
p=[int(input())-1for _ in[0]*n]
q=[0]*n
for i in range(n):q[p[i]]=i
r,c=0,1
for i in range(n-1):
    c=c+1if q[i]<q[i+1]else 1
    if r<c:r=c
if r<c:r=c
print(n-r)
n,k = input().split()
m = [int(x) for x in input().split()]
m.sort()
for i in range(k):
  if len(m) == 0:
    break
  m.pop(len(m))
print(sum(m))

### FIXED CODE ###

n,k = [int(x) for x in input().split()]
m = [int(x) for x in input().split()]
m.sort()
if n<k:
  k = n
print(sum(m[0:n-k]))
def gcd(a, b):
    if (a == b):
        return a
    elif (a == 0):
        return b
    elif (b == 0):
        return a
    elif (a < b):
        return gcd(a, b - a)
    elif (b < a):
        return gcd(b, a - b)


n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
ans = 0

for e in a:
    if (len(a) <= 2):
        ans = a[0]
    else:
        a.remove(e)
        rep = a[0]

        for elem in a:
            rep = gcd(rep, elem)

        if (ans < rep):
            ans = rep

        a.append(e)

print(ans)


### FIXED CODE ###

from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
left = [0] * (n + 1)
right = [0] * (n + 1)
middle = [0] * (n + 1)

for i in range(0, n - 1):
    left[i + 1] = gcd(left[i], a[i])

for i in range(n - 1, 0, -1):
    right[i] = gcd(right[i + 1], a[i])

for i in range(n):
    middle[i] = gcd(left[i], right[i + 1])

print(max(middle))
N, M = map(int, input().split())
grid = [[c for c in input()] for _ in range(N)]
mat = [[float('inf')]*(M*N) for _ in range(N*M)]

DX = [0, 0, 1, -1]
DY = [-1, 1, 0, 0]
for row in range(N):
    for col in range(M):
        if grid[row][col] == "#":
            continue
        for dx, dy in zip(DX, DY):
            if 0 <= row+dx < N and 0 <= col+dy < M:
                if grid[row+dx][col+dy] == "#":
                    continue
                mat[(row+dx)*M+col+dy][row*M+col] = 1
                mat[row*M+col][(row+dx)*M+col+dy] = 1
for k in range(N*M):
    for i in range(N*M):
        for j in range(N*M):
            mat[i][j] = min(mat[i][j], mat[i][k] + mat[k][j])
ans = 0
for srow in range(N):
    for scol in range(M):
        if grid[srow][scol] == "#":
            continue
        for erow in range(N):
            for ecol in range(M):
                if grid[erow][ecol] == "#":
                    continue
                else:
                    ans = max(mat[srow*M+scol][erow*M+ecol], ans)
print(ans)


### FIXED CODE ###

C=input()
print(chr(ord(C)+1))
s=input()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  su+=eval(calcs)
print(su)

### FIXED CODE ###

import sys
s=input()
if(len(s)==1):
  print(s)
  sys.exit()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  su+=eval(calcs)
print(su)
import os

if __name__ == "__main__":
    temp = input().split(" ")
    N = temp[0]
    L = int(temp[1])
    D = list(map(int, input().split(" ")))
    
    like = []
    for i in range(0, 10):
        if D.count(i) == 0:
            like.append(i)
   
    ans = []
    for n in N:
        for l in like:
            if int(l) >= int(n):
                ans.append(l)
                break
    if int("".join(map(str, ans))) < int("".join(map(str, N))):
        ans = []
        for i in range(0, len(N)):
            ans.append(min(like))
            
    print("".join(map(str, ans)))  
    

### FIXED CODE ###


def main():
    N, K = input().split(" ")

    D = list(input().split(" "))
    use_num = list(set([str(i) for i in range(10)]) - set(D))

    N = int(N)
    i = N
    while True:

        if not set(str(i)) <= set(use_num) and i >= N:
            i += 1
        else:
            print(i)
            break

if __name__ == "__main__":
    main()