# -*- coding: utf-8 -*-
"""
Created on Thu Jun 25 19:35:21 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=0
for i in range(len(strr)):
    if strr[i]==maxx:
        cnt1=cnt1+1
    if cnt1>2:
        break
if cnt1>2:
    index=[]
elif cnt1==2:
    print('Hi')
    if sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:

    if strr.count(strr[1])==1:
        if sum(strr)==2*strr[1]+maxx:
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 05:17:52 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=strr.count(maxx)
if cnt1>2:
    if cnt1==len(strr):
        index=list(range(1,len(strr)+1,1))
elif cnt1==2:
    if len(strr)==3:
        for i in range(3):
            if copy_str[i]!=maxx:
                index.append(i+1)
    elif sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:

    if strr.count(strr[1])==1:
        if sum(strr)==2*strr[1]+maxx:
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:
                if cnt==len(strr)-1:
                    i=copy_str.index(maxx)+1
                    index=list(range(1,len(strr)+1,1))
                    del(index[i-1])
                    break

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])
            if sum(strr)>2*maxx+strr[j]:
                break

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 05:17:52 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=strr.count(maxx)
if cnt1>2:
    if cnt1==len(strr):
        index=list(range(1,len(strr)+1,1))
elif cnt1==2:
    if len(strr)==3:
        for i in range(3):
            if copy_str[i]==maxx:
                index.append(i+1)
    elif sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:

    if strr.count(strr[1])==1:
        if sum(strr)==2*strr[1]+maxx:
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:
                if cnt==len(strr)-1:
                    i=copy_str.index(maxx)+1
                    index=list(range(1,len(strr)+1,1))
                    del(index[i-1])
                    break

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])
            if sum(strr)>2*maxx+strr[j]:
                break

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 05:17:52 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=strr.count(maxx)
if cnt1>2:
    if cnt1==len(strr):
        index=list(range(1,len(strr)+1,1))
elif cnt1==2:

    if sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:

    if strr.count(strr[1])==1:
        if sum(strr)==2*strr[1]+maxx:
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:
                if cnt==len(strr)-1:
                    i=copy_str.index(maxx)+1
                    index=list(range(1,len(strr)+1,1))
                    del(index[i-1])
                    break

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])
            if sum(strr)>2*maxx+strr[j]:
                break

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 05:17:52 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=0
for i in range(len(strr)):
    if strr[i]==maxx:
        cnt1=cnt1+1
    if cnt1>2:
        break
if cnt1>2:
    index=[]
elif cnt1==2:
    print('Hi')
    if sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:

    if strr.count(strr[1])==1:
        if sum(strr)==2*strr[1]+maxx:
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:
                if cnt==len(strr)-1:
                    i=copy_str.index(maxx)+1
                    index=list(range(1,len(strr)+1,1))
                    del(index[i-1])
                    break

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])
            if sum(strr)>2*maxx+strr[j]:
                break

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 05:17:52 2020

@author: Dark Soul
"""

n=input('')
n=int(n)
strrr = list(map(int, input().split()))
copy_str=strrr
strr=sorted(strrr,reverse=True)
index=[]
maxx=strr[0]
cnt1=strr.count(maxx)
if cnt1>2:
    if cnt1==len(strr) and len(strr)==3:
        index=list(range(1,len(strr)+1,1))
elif cnt1==2:
    if len(strr)==3:
        for i in range(3):
            if copy_str[i]!=maxx:
                index.append(i+1)
    elif sum(strr)==3*maxx:
        my_str=copy_str
        index.append(my_str.index(maxx)+1)
        del(my_str[my_str.index(maxx)])
        index.append(my_str.index(maxx)+2)
    else:
        index=[]
else:
    if strr.count(strr[1])==1 or (len(strr)==3 and strr.count(strr[1])==2):
        if (sum(strr)==2*strr[1]+maxx):
            index.append(copy_str.index(maxx)+1)
    if sum(strr)>2*maxx:
        j=1
        while j<len(strr):
            cnt=strr.count(strr[j])
            if sum(strr)==2*maxx+strr[j]:
                if cnt==len(strr)-1:
                    i=copy_str.index(maxx)+1
                    index=list(range(1,len(strr)+1,1))
                    del(index[i-1])
                    break

                my_str=copy_str

                for k in range(cnt):

                    ind=my_str.index(strr[j])+k+1
                    index.append(ind)
                    del(my_str[ind-k-1])
            if sum(strr)>2*maxx+strr[j]:
                break

            j=j+cnt

y=len(index)
print(len(index))
if n==0:
    print('')
else:
    print(*index)


n = int(input())
arr = [int(x) for x in input().split()]
duplArr = arr[:]

ind = []
res = []
sumAll = sum(arr)
maxN = max(arr)
duplArr.remove(maxN)
secondMaxN = max(duplArr)
if(sum(duplArr) - secondMaxN == secondMaxN):
	ind.append(maxN)

for i in range(n):
	if(arr[i] in ind):
		res.append(i+1)
		continue
	if(arr[i] == maxN):
		continue
	s = sumAll - arr[i]
	if(s - maxN == maxN):
		ind.append(arr[i])
		res.append(i+1)

print(len(res))
print(*res)


n = int(input())
arr = [int(x) for x in input().split()]

ind = []
sortedArr = arr[:]
sortedArr.sort()
for i in range(n-1):
	if(sortedArr[i] != sortedArr[i-1]):
		s = sum(sortedArr) - sortedArr[i]
		if(s - sortedArr[n-1] == sortedArr[n-1]):
			ind.append(sortedArr[i])

s = sum(sortedArr) - sortedArr[n-1]
if(s - sortedArr[n-2] == sortedArr[n-2]):
	ind.append(sortedArr[n-1])

res = [i+1 for j in range(len(ind)) for i in range(n) if(arr[i] == ind[j])]
print(len(res))
print(*res)


n = int(input())
arr = [int(x) for x in input().split()]

ans = []
sortedArr = arr[:]
sortedArr.sort()
for i in range(n-1):
	if(sortedArr[i] != sortedArr[i-1]):
		s = sum(sortedArr) - sortedArr[i]
		if(s - sortedArr[n-1] == sortedArr[n-1]):
			while sortedArr[i] in arr:
				ans.append(arr.index(sortedArr[i])+1)
				arr[arr.index(sortedArr[i])] = -1

s = sum(sortedArr) - sortedArr[n-1]
if(s - sortedArr[n-2] == sortedArr[n-2]):
	ans.append(arr.index(sortedArr[n-1])+1)

print(len(ans))
print(*ans)


n = int(input())
arr = [int(x) for x in input().split()]

ind = []
res = []
sumAll = sum(arr)
maxN = max(arr)
for i in range(n):
	if(arr[i] in ind):
		res.append(i+1)
		continue
	if(arr[i] == maxN):
		continue
	s = sumAll - arr[i]
	if(s - maxN == maxN):
		ind.append(arr[i])
		res.append(i+1)

maxElIndex = arr.index(maxN)
arr.remove(maxN)
maxN = max(arr)
if(sum(arr) - maxN == maxN):
	res.append(maxElIndex+1)

print(len(res))
print(*res)


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3 and a[0]==a[1]==a[2]:
    print(3)
    print(1,2,3)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            t.append(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
    for i in range(len(t)):
        print(t[i], end=' ')


n=int(input())
s=0
am=0
ai=-1
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if bm==s-am-bm:
    t.append(ai)
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
elif p==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
print(len(t))
for i in range(len(t)):
    if k=='':
        k=str(t[i])
    else:
        k=k+' '+str(t[i])
print(k)


n=int(input())
k=[]
s=0
t=''
a1=0
a2=0
i2=[]
i1=[]
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>a2:
        '''i1=i2'''
        a1=a2
        '''i2=[]'''
        a2=a[i]
        '''i2.append(i)'''
    '''if a[i]==a2:
        i2.append(i)'''
    if a[i]<a2 and a[i]>a1:
        a1=a[i]
        '''i1=[]
        i1.append(i)'''
'''    if a[i]==a1:
        i1.append(i)'''

for i in range(n):
    if a[i]==a2:
        if s-a2-a1==a1:
            k.append(i)
    else:
        if s-a[i]-a2==a2:
            k.append(i)
if len(k)>0:
    print(len(k))
    for i in range (len(k)-1):
        t=t+str(k[i]+1)+' '
    t=t+str(k[len(k)-1]+1)
    print(t)
else:
    print(0)


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
    else:
        print(0)
elif p==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    if bm==s-am-bm:
        t.append(ai)
print(len(t))
for i in range(len(t)):
    if k=='':
        k=str(t[i])
    else:
        k=k+' '+str(t[i])
print(k)


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3:
    if a[0]==a[1]==a[2]:
        print(3)
        print(1,2,3)
    elif a[0]==a[1]:
        print(1)
        print(3)
    elif a[1]==a[2]:
        print(1)
        print(1)
    elif a[0]==a[2]:
        print(1)
        print(2)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            print(2)
            print(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
        for i in range(len(t)):
            print(t[i], end=' ')


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3:
    if a[0]==a[1]==a[2]:
        print(3)
        print(1,2,3)
    if a[0]==a[1]:
        print(1)
        print(3)
    if a[1]==a[2]:
        print(1)
        print(1)
    if a[0]==a[2]:
        print(1)
        print(2)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            t.append(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
    for i in range(len(t)):
        print(t[i], end=' ')


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
    else:
        print(0)
elif p==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    if bm==s-am-bm:
        t.append(ai)
print(len(t))
for i in range(len(t)):
    print(t[i], end=' ')


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3:
    if a[0]==a[1]==a[2]:
        print(3)
        print(1,2,3)
    elif a[0]==a[1]:
        print(1)
        print(3)
    elif a[1]==a[2]:
        print(1)
        print(1)
    elif a[0]==a[2]:
        print(1)
        print(2)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            t.append(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
    for i in range(len(t)):

        print(t[i], end=' ')


n=int(input())
s=0
am=0
ai=-1
bm=0
t=[]
k=''
l=[]
z=[]
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        l=z
        z=[]
        z.append(i+1)
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
        z.append(i+1)
    elif a[i]<am and a[i]>bm:
        bm=a[i]
        l=[]
        l.append(i+1)
    elif a[i]==bm:
        l.append(i+1)
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
elif p==1:
    d=s-2*am
    if bm==d:
        t=l
    if bm>d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
if bm==s-am-bm:
    t.append(ai)
print(len(t))
for i in range(len(t)):
    if k=='':
        k=str(t[i])
    else:
        k=k+' '+str(t[i])
print(k)


n=int(input())
s=0
am=0
ai=-1
bm=0
t=[]
k=''
l=[]
z=[]
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        l=z
        z=[]
        z.append(i+1)
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
        z.append(i+1)
    elif a[i]<am and a[i]>bm:
        bm=a[i]
        l=[]
        l.append(i+1)
    elif a[i]==bm:
        l.append(i+1)
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
elif p==1:
    d=s-2*am
    if bm==d:
        t=l
    if bm>d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
if bm==s-am-bm:
    t.append(ai)
print(len(t))
for i in range(len(t)):
    if k=='':
        k=str(t[i])
    else:
        k=k+' '+str(t[i])

print(k)


n=int(input())
s=0
am=0
ai=-1
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if bm==s-am-bm:
    t.append(ai)
d=s-2*am
if bm>=d:
    for i in range(len(a)):
        if a[i]==d:
            t.append(i+1)
print(len(t))
for i in range(len(t)):
    if k=='':
        k=str(t[i])
    else:
        k=k+' '+str(t[i])
print(k)


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3:
    if a[0]==a[1]==a[2]:
        print(3)
        print(1,2,3)
    elif a[0]==a[1]:
        print(1)
        print(3)
    elif a[1]==a[2]:
        print(1)
        print(1)
    elif a[0]==a[2]:
        print(1)
        print(2)
    else:
        print(0)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            print(2)
            print(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
        for i in range(len(t)):
            print(t[i], end=' ')


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
    else:
        print(0)
elif p==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    if bm==s-am-bm:
        t.append(ai)
    print(len(t))
for i in range(len(t)):
    print(t[i], end=' ')


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        bm=am
        am=a[i]
        ai=i+1
        p=1
    elif a[i]==am:
        p+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        bm=a[i]
if p>2:
    print(0)
elif p==2:
    if am==s-2*am:
        t.append(ai,ai2)
    else:
        print(0)
elif p==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    if bm==s-am-bm:
        t.append(ai)
    print(len(t))
    for i in range(len(t)):
        if k=='':
            k=str(t[i])
        else:
            k=k+' '+str(t[i])
    print(k)


n=int(input())
s=0
am=0
ka=0
kb=0
ai1=-1
ai2=-1
bm=0
t=[]
k=''
m=0
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>am:
        kb=ka
        ka=1
        bm=am
        ai1=i+1
        ai2=-1
        am=a[i]
    elif a[i]==am:
        ka+=1
        ai2=i+1
    elif a[i]<am and a[i]>bm:
        kb=1
        bm=a[i]
    elif a[i]==bm:
        kb+=1
if ka>2:
    print(0)
elif ka==2:
    if am==s-2*am:
        print(2)
        print(ai1,ai2)
    else:
        print(0)
elif ka==1 and kb==1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    if bm==s-am-bm:
        k=str(ai1)
        m=1
    for i in range(len(t)):
        if k=='':
            k=str(t[i])
        else:
            k=k+' '+ str(t[i])
    print(len(t)+m)
    print(k)
elif ka==1 and kb>1:
    d=s-2*am
    if bm>=d:
        for i in range(len(a)):
            if a[i]==d:
                t.append(i+1)
    for i in range(len(t)):
        if k=='':
            k=str(t[i])
        else:
            k=k+' '+ str(t[i])
    print(len(t))
    print(k)
else:
    print(0)


n=int(input())
k=[]
s=0
t=''
a1=0
a2=0
i2=[]
i1=[]
a=input().split()
for i in range(n):
    a[i]=int(a[i])
    s+=a[i]
    if a[i]>a2:
        i1=i2
        a1=a2
        i2=[]
        a2=a[i]
        i2.append(i)
    if a[i]==a2:
        i2.append(i)
    if a[i]<a2 and a[i]>a1:
        a1=a[i]
        i1=[]
        i1.append(i)
    if a[i]==a1:
        i1.append(i)
for i in range(n):
    if a[i]==a2:
        if s-a2-a1==a1:
            k.append(i)
    else:
        if s-a[i]-a2==a2:
            k.append(i)
if len(k)>0:
    print(len(k))
    for i in range (len(k)-1):
        t=t+str(k[i]+1)+' '
    t=t+str(k[len(k)-1]+1)
    print(t)
else:
    print(0)


n=int(input())
s=0
am=0
bm=0
t=[]
k=''
a=input().split()
if n==3:
    if a[0]==a[1]==a[2]:
        print(3)
        print(1,2,3)
    elif a[0]==a[1]:
        print(1)
        print(3)
    elif a[1]==a[2]:
        print(1)
        print(1)
    elif a[0]==a[2]:
        print(1)
        print(2)
else:
    for i in range(n):
        a[i]=int(a[i])
        s+=a[i]
        if a[i]>am:
            bm=am
            am=a[i]
            ai=i+1
            p=1
        elif a[i]==am:
            p+=1
            ai2=i+1
        elif a[i]<am and a[i]>bm:
            bm=a[i]
    if p>2:
        print(0)
    elif p==2:
        if am==s-2*am:
            t.append(ai,ai2)
        else:
            print(0)
    elif p==1:
        d=s-2*am
        if bm>=d:
            for i in range(len(a)):
                if a[i]==d:
                    t.append(i+1)
        if bm==s-am-bm:
            t.append(ai)
        print(len(t))
    for i in range(len(t)):
        print(t[i], end=' ')


n = int(input())
arr = list(map(int, input().split()))

res = []
_max = max(arr)
_semi_max = 0
_sum = sum(arr)

for i in range(0, n):
    if arr[i] < _max:
        _semi_max = max(_semi_max, arr[i])

for i in range(0, n):
    if arr[i] != _max:
        if _sum - arr[i] - _max == _max:
            res.append(i + 1)
    else:
        if _sum - arr[i] - _semi_max == _semi_max:
            res.append(i + 1)

print(len(res))
if len(res) > 0:
    print(' '.join(map(str, res)))


n = int(input())
arr = list(map(int, input().split()))

res = []
_max = max(arr)
_semi_max = 0
_sum = sum(arr)

for i in range(0, n):
    if arr[i] <= _max:
        _semi_max = max(_semi_max, arr[i])

for i in range(0, n):
    if arr[i] != _max:
        if _sum - arr[i] - _max == _max:
            res.append(i + 1)
    else:
        if _sum - arr[i] - _semi_max == _semi_max:
            res.append(i + 1)

print(len(res))
if len(res) > 0:
    print(' '.join(map(str, res)))


n = int(input())
arr = list(map(int, input().split()))

res = []
_max = 0
_max_id = -1
for i in range(0, n):
    if _max < arr[i]:
        _max = arr[i]
        _max_id = i
_semi_max = 0
_sum = sum(arr)

for i in range(0, n):
    if arr[i] <= _max and i != _max_id:
        _semi_max = max(_semi_max, arr[i])

for i in range(0, n):
    if arr[i] != _max:
        if _sum - arr[i] - _max == _max:
            res.append(i + 1)
    else:
        if _sum - arr[i] - _semi_max == _semi_max:
            res.append(i + 1)

print(len(res))
if len(res) > 0:
    print(' '.join(map(str, res)))


cnt = lambda s, x: s.count(x)
ii = lambda: int(input())
si = lambda: input()
f = lambda: map(int, input().split())
dgl = lambda: list(map(int, input()))
il = lambda: list(map(int, input().split()))
n=ii()
l=il()
lenm={}
l1=[]
x=0
for i in range(1,n+1):
    lenm[i]=l[i-1]
lenm=sorted(lenm.items(),key= lambda ky:(ky[1],ky[0]))
if n>2:
    for i in range(n-2):
        x+=lenm[i][1]
    if x==lenm[n-2][1]:
        l1.append(lenm[n-1][0])
    x+=lenm[n-2][1]
    if x==lenm[n-1][1]:
        l1.append(lenm[n-2][0])
    for i in range(n-1):
        y=x-lenm[i][1]
        if y==lenm[n-1][1]:
            l1.append(lenm[i][0])
    print(len(l1))
    print(*l1)
else:
    print(0)


cnt = lambda s, x: s.count(x)
ii = lambda: int(input())
si = lambda: input()
f = lambda: map(int, input().split())
dgl = lambda: list(map(int, input()))
il = lambda: list(map(int, input().split()))
n=ii()
l=il()
lenm={}
l1=[]
x=0
for i in range(1,n+1):
    lenm[i]=l[i-1]
lenm=sorted(lenm.items(),key= lambda ky:(ky[1],ky[0]))
for i in range(n-2):
    x+=lenm[i][1]
if x==lenm[n-2][1]:
    l1.append(lenm[n-1][0])
x+=lenm[n-2][1]
if x==lenm[n-1][1]:
    l1.append(lenm[n-2][0])
for i in range(n-1):
    y=x-lenm[i][1]
    if y==lenm[n-1][1]:
        l1.append(lenm[i][0])
print(len(l1))
print(*l1)


cnt = lambda s, x: s.count(x)
ii = lambda: int(input())
si = lambda: input()
f = lambda: map(int, input().split())
dgl = lambda: list(map(int, input()))
il = lambda: list(map(int, input().split()))
n=ii()
l=il()
lenm={}
l1=[]
x=0
for i in range(1,n+1):
    lenm[i]=l[i-1]
lenm=sorted(lenm.items(),key= lambda ky:(ky[1],ky[0]))
if n>2:
    for i in range(n-2):
        x+=lenm[i][1]
    if x==lenm[n-2][1]:
        l1.append(lenm[n-1][0])
    x+=lenm[n-2][1]
    for i in range(n-1):
        y=x-lenm[i][1]
        if y==lenm[n-1][1]:
            l1.append(lenm[i][0])
    print(len(l1))
    print(*l1)
else:
    print(0)


#include<iostream>
#include<algorithm>

using namespace std;

int main()
{

	int n,arr[1006],x,sum=0,ans;
	cin>>n>>x;
	for (int i = 0; i <n; i++)
	{
	cin>>arr[i];
	}
	for (int i = 0; i <n; i++)
	{
		sum+=arr[i];
	}
	ans=sum/x;

	ceil(ans);

	cout<<abs(ans)<<endl;

    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main()
{

	int n,arr[1006],x,sum=0,ans;
	cin>>n>>x;
	for (int i = 0; i <n; i++)
	{
	cin>>arr[i];

	while (x>=arr[i])

	continue;
	}
	for (int i = 0; i <n; i++)
	{
		sum+=arr[i];
	}
	ans=sum/x;

	ceil(ans);

	cout<<ans<<endl;

	//system("pause");

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i,sum=0,r;
    cin>>n>>x;
    int a[n];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
        r=abs(sum);
    }

    if(r==0)
    {
        cout<<0<<endl;
    }
    else if(r<=x)
    {
        cout<<1<<endl;
    }
    else
    {
        cout<<(r/x)+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i,sum=0,r;
    cin>>n>>x;
    int a[n];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
        r=abs(sum);
    }

    if(r==0)
    {
        cout<<0<<endl;
    }
    else if(r<=x)
    {
        cout<<r/x<<endl;
    }
    else
    {
        cout<<(r/x)+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i,sum=0,r;
    cin>>n>>x;
    int a[n];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
        r=abs(sum);
    }

    if(r==0)
    {
        cout<<0<<endl;
        return 0;
    }
    else if(r<=x)
    {
        cout<<1<<endl;
    }
    else if(r>x && r%x==0)
    {
        cout<<r/x<<endl;
    }
    else
    {
        cout<<(r/x)+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i,sum=0,r;
    cin>>n>>x;
    int a[n];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
        r=abs(sum);
    }

    if(r==0)
    {
        cout<<0<<endl;
    }
    else if(r<=x)
    {
        cout<<1<<endl;
    }
    else
    {
        cout<<(r/x)+1<<endl;
    }
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,i,sum=0,r;
    cin>>n>>x;
    int a[n];
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
        r=abs(sum);
    }

    if(r==0)
    {
        cout<<0<<endl;
    }
    else if(r<=x)
    {
        cout<<1<<endl;
    }
    else
    {
        cout<<(r/x)+1<<endl;
    }
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n,m,a;cin>>n>>m;long long r=0;
    for(int i=0;i<n;i++)cin>>a,r+=a;
    r=abs(r);
    cout<<(r+r-1)/m;
    return 0;
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n,b;
    cin>>n>>b;
    int ar[n];
    int s=0;
    for(int i=0;i<n;i++){cin>>ar[i];s=s+ar[i];}
    s=fabs(s);
    if(s==0)cout<<0;
else if(s>b){
  int r;

  if((double)s/b>s/b)r=s/b+1;
  else r=s/b;
  cout<<r;
}
else cout<<1;

    return 0;
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n,m,a;cin>>n>>m;long long r=0;
    for(int i=0;i<n;i++)cin>>a,r+=a;
    r=abs(r);
    cout<<(r+m-1)/m;
    return 0;
}


#include <iostream>
#include<algorithm>
#include<cmath>
using namespace std;
bool com(int a,int b){
if(fabs(a)<fabs(b))return true;

  else return false;
}
int main()
{
    int n;cin>>n;
    int m;cin>>m;
    int ar[n];
    for(int i=0;i<n;i++){
      cin>>ar[i];
    }
sort(ar,ar+n,com);int f=0;
for(int i=0;i<n;i++){
  int r=0;int j=0;
  for(j=i;j<n;j++){
    if(fabs(ar[i])==fabs(ar[j])){r=r+ar[j];}
    else {break;}
  }
f=f+fabs(r/ar[i]);i=j-1;
}
cout<<f;
    return 0;
}


//ITOG
#include <bits/stdc++.h>
bool ch[100001]={0};
using namespace std;

int main()
{
	int n,x ,ans=0;
	int a[1000];
	cin>>n>>x;
	for(int i=0;i<n;i++)
		cin>>a[i] , ans+=a[i];
	if(ans==0) return cout<<"0"<<endl , 0;
	if(abs(ans) <= x) return cout<<'1'<<endl , 0;
	else cout<<abs(ans)/x  + 1<<endl;
}


#include <SDL/SDL.h>
#include <iostream>

using namespace std;
bool showen[10][10];
int map[10][10];

int c=0,x,y,i,j;
	bool finished=true,drawed=true;
	SDL_Event e;
	SDL_Rect r;
	SDL_Surface *screen = SDL_SetVideoMode(200,200,32,SDL_SWSURFACE);
	SDL_Surface *images[10];
	//unsigned char *data=(unsigned char *)screen->pixels;
	SDL_Surface *a = SDL_LoadBMP("/home/amirrza/Desktop/project/0.bmp");
void NewMap(bool showen[][10],int x,int y)
{
//int i,j;
SDL_Init (SDL_INIT_EVERYTHING);

	for (i=0;i<10;i++)
	{
		for (j=0;j<10;j++)
		{
			if (showen[i][j])
			{
				char s[100];
				sprintf(s,"/home/amirrza/Desktop/project/%d.bmp",map[i][j]);
				a=SDL_LoadBMP(s);
					for (i=0;i<200;i++)
				{
					for (j=0;j<200;j++)
					{
					r.x=j*20; r.y=20*i; r.w=20; r.h=20;
					SDL_BlitSurface(a,0,screen,&r);
					}
				}

			}

		}
	}
SDL_Flip(screen);

}
int main()
{
	SDL_Init (SDL_INIT_EVERYTHING);
//	int c=0,x,y,i,j;
//	bool finished=True,drawed=True;
//	SDL_Event e;
//	SDL_Surface *screen = SDL_SetVideoMode(200,200,32,SDL_SWSURFACE);
//	SDL_Surface *images[10];
//	unsigned char *data=(unsigned char *)screen->pixels;
/////	SDL_Surface *a = SDL_LoadBMP("/home/amirrza/Desktop/project/0.bmp");

		//bomb set
		for (i=0;i<10;i++)
		{
		do{
			x=rand()%10;
			y=rand()%10;
		}while (map[x][y] == 9);
		map[x][y]=9;
		}
		//inint other
		for (i=0;i<10;i++)
			for(j=0;j<10;j++)
				if (map[i][j] !=9 )
					for (x=0;x=max(0,i-1);x<min(10,i+2))
						for(y=0;y=max(0,j-1);y<min(10,j+2))
							if (map[x][y] == 9 )
								map[i][j]++;
		while (!finished)
		{
		SDL_PollEvent(&e);
		if (e.type == SDL_MOUSEBUTTON)
		{
			SDL_GetMouseState(&x,&y);
			x=x/20;
			y=y/20;
			showen[x][y]=false;
			NewMap(showen[x][y],x,y);
		}

//	SDL_Flip(screen);
//	SDL_Delay(2000);

}


//ITOG
#include <bits/stdc++.h>
bool ch[100001]={0};
using namespace std;

int main()
{
	int n,x ,ans=0;
	int a[1000];
	cin>>n>>x;
	for(int i=0;i<n;i++)
		cin>>a[i] , ans+=a[i];
	if(ans==0) return cout<<"0"<<endl , 0;
	if(abs(ans) <= x) return cout<<'1'<<endl , 0;
	if(abs(ans)%x==0) return cout<<abs(ans)/x<<endl , 0;
	cout<<abs(ans) / x +1<<endl;
}


//ITOG
#include <bits/stdc++.h>
bool ch[100001]={0};
using namespace std;

int main()
{
	int n,x ,ans=0;
	int a[1000];
	cin>>n>>x;
	for(int i=0;i<n;i++)
		cin>>a[i] , ans+=a[i];
	if(ans==0) return cout<<"0"<<endl , 0;
	if(abs(ans) <= x) return cout<<'1'<<endl , 0;
	else cout<<abs(ans)/x  + abs(ans)%x<<endl;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( sum ==0 )
    {
        goto label;
        a = 0;
    }

    if ( -sum <= x && -sum >= -x)
    a = 1;

    else
    {
        if ( sum < 0 )
            sum = -sum;

        if ( sum % x == 0 )
            a = sum / x;
        else a = sum / x + 1;
    }

    label:

    cout <<a <<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( -sum <= x && -sum >= -x)
    a = 1;

    else if ( sum < 0 )
        a = -sum / x + 1;
    else a = sum / x + 1;

    cout <<a <<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( -(sum) <= x )
    a = 1;

    else for (; j >= 0; j -= 1 )
    {
        if ( v[j] > x )
            a += 2;
        else a++;
    }

    cout <<a <<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( sum ==0 )
    {
        goto label;
        a = 0;
    }

    if ( -sum <= x && -sum >= -x)
    a = 1;

    else if ( sum < 0 )
        a = -sum / x + 1;
    else a = sum / x + 1;

    label:

    cout <<a <<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( -sum <= x && -sum >= -x)
    a = 1;

    else a = sum / x + 1;

    cout <<a <<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , x , sum=0 , a=0 , j=0;

    cin >>n >>x;

    int v[n];

    for ( int i=0; i < n; i++ )
    {
        cin >>v[i];
        sum += v[i];
        j = i;
    }

    if ( -sum <= x && -sum >= -x)
    a = 1;

    else for (; j >= 0; j -= 1 )
    {
        if ( v[j] > x )
            a += 2;
        else a++;
    }

    cout <<a <<endl;

    return 0;
}


#include<string.h>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
int main()
{
    int n,m;
    int a[1005];
    int b[1002];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    int sum=0;
    int ans=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    if(!sum)
        printf("0\n");
    else
    {
        printf("%d\n",(abs(sum)-1)/m+1);
    }
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
    int n,m,a;
    while(~scanf("%d%d",&n,&m))
    {
        int sum=0;
        for(int i=0;i<n;i++)
        {
            scanf("%d",&a);
            sum+=a;
        }
        int  k=(abs(sum)-1)/m+1;
        printf("%d\n",k);
    }
}


#include <iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<map>
#include<queue>
using namespace std;
int main()
{
    int n,m;
    int a[1005];
    int b[1002];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(b[i]==0&&b[j]==0&&(a[j]+a[i]==0)&&((a[j]<=m&&a[j]>=-m)||(a[i]<=m&&a[i]>=-m)))
            {
                b[j]=1;
                b[i]=1;
               // printf("%d\n",a[i]);
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        if(!b[i]&&a[i]<=m&&a[i]>=-m)
        {
            ans++;
           // printf("%d\n",a[i]);
        }
    }
    printf("%d\n",ans);
}


#include <iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<map>
#include<queue>
using namespace std;
int main()
{
    int n,m;
    int a[1005];
    int b[1002];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(b[i]==0&&b[j]==0&&(a[j]+a[i]==0)&&((a[j]<=m&&a[j]>=-m)||(a[i]<=m&&a[i]>=-m)))
            {
                b[j]=1;
                b[i]=1;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        if(!b[i]&&a[i]<=m&&a[i]>=-m&&a[i]!=0)
        {
            ans++;
           // printf("%d\n",a[i]);
        }
    }
    printf("%d\n",ans);
}


#include <iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<map>
#include<queue>
using namespace std;
int main()
{
    int n,m;
    int a[1005];
    int b[1002];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    int ans=n;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(!b[i]&&!b[j]&&!(a[j]+a[i]))
            {
                b[j]=1;
                b[i]=1;
                ans-=2;
            }
        }
    }
    printf("%d\n",ans);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
    int n,m,a;
    while(~scanf("%d%d",&n,&m))
    {
        int sum=0;
        for(int i=0; i<n; i++)
        {
            scanf("%d",&a);
            sum+=a;
        }
        if(sum==0)
            printf("0\n");
        else
        {
            int  k=(abs(sum)-1)/m+1;
            printf("%d\n",k);
        }
    }
}


# include <bits/stdc++.h>

using namespace std;

#define Jovid_Mahmudov main()

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair < ll, ll > pll;
typedef pair < int, int > pii;

ll n,m,i,ans,k;

int main()
{
    cin >> n >> m;
    ll a[n + 1];
    for(i = 1;i <= n;i++)
    {
        cin >> a[i];
        ans += a[i];
    }
    if(ans == 0)
       {
           cout << 0;
           return 0;
       }
    if(ans < 0) ans = -ans;
        if(ans <= m)
        {
            cout  << 1;
            return 0;
        }
        ll k = 0;
        for(i = m;i >= 1;i--)
        {
            if(ans - i <= m) ans -= i,k++;
            while(ans - i > m)
            {
                ans -= i;
                k++;
            }
            if(ans == 0)
            {
                cout << k;
                return 0;
            }
            if(ans <= m)
            {
                k++;
                cout << k;
                return 0;
            }
        }
        cout << ans;
    return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define Jovid_Mahmudov main()

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair < ll, ll > pll;
typedef pair < int, int > pii;

ll n,m,i,ans,k;

int main()
{
    cin >> n >> m;
    ll a[n + 1];
    for(i = 1;i <= n;i++)
    {
        cin >> a[i];
        ans += a[i];
    }
    if(ans < 0) ans = -ans;
        if(ans <= m)
        {
            cout  << 1;
            return 0;
        }
        ll k = 0;
        for(i = m;i >= 1;i--)
        {
            if(ans - i <= m) ans -= i,k++;
            while(ans - i > m)
            {
                ans -= i;
                k++;
            }
            if(ans <= m)
            {
                k++;
                cout << k;
                return 0;
            }
        }
        cout << ans;
    return 0;
}


# include <iostream>
using namespace std;
long long n,x,i,s;
int main()
{
  cin >> n >> x;
  long long a[n + 1];
  for(i = 1;i <= n;i++)cin >> a[i],s += a[i];
  if(s < 0)s = -s;
  if(s <= x)
  {
    cout << 1;
    return 0;
  }
  else
  {
    cout << int(s % x) + int(s / x);
    return 0;
  }
  return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define Jovid_Mahmudov main()

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair < ll, ll > pll;
typedef pair < int, int > pii;

ll n,m,i,ans,k;

int main()
{
    cin >> n >> m;
    ll a[n + 1];
    for(i = 1;i <= n;i++)
    {
        cin >> a[i];
        ans += a[i];
    }
    if(ans < 0) ans = -ans;
    cout << ans / m + (ans % m != 0);
    return 0;
}


# include <iostream>
using namespace std;
long long n,x,i,s,k;
int main()
{
  cin >> n >> x;
  long long a[n + 1];
  for(i = 1;i <= n;i++)cin >> a[i],s += a[i];
  if(s < 0)s = -s;
  while(s > 0)
  {
    s -= x;
    k++;
  }
  cout << k;
  return 0;
}


# include <bits/stdc++.h>

using namespace std;

#define Jovid_Mahmudov main()

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair < ll, ll > pll;
typedef pair < int, int > pii;

ll n,m,i,ans,k;

int main()
{
    cin >> n >> m;
    ll a[n + 1];
    for(i = 1;i <= n;i++)
    {
        cin >> a[i];
        ans += a[i];
    }
    if(ans < 0) ans = -ans;
        if(ans <= m)
        {
            cout  << 1;
            return 0;
        }
        ll k = 0;
        for(i = m;i >= 1;i--)
        {
            if(ans - i <= m) ans -= i,k++;
            while(ans - i > m)
            {
                ans -= i;
                k++;
            }
            if(ans == 0)
            {
                cout << k;
                return 0;
            }
            if(ans <= m)
            {
                k++;
                cout << k;
                return 0;
            }
        }
        cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>

using namespace std;

int main()
{
    long long int i,n,m,d,t,sum=0;
    cin >> n>>m;
    for(i=0;i<n;i++)
    {
        cin >>d;
        sum+=d;
    }
    sum=abs(sum);
    t=sum/m;
    if(sum>(t*m))
    {
        cout << t+1 ;
    }
    else
    {
        cout << t;
    }
}


#include <bits/stdc++.h>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>

using namespace std;

int main()
{
    long long int i,n,m,d,t,sum=0;
    cin >> n>>m;
    for(i=0;i<n;i++)
    {
        cin >>d;
        sum+=d;
    }
    sum=abs(sum);
    t=sum/m;
    if(sum>t)
    {
        cout << t+1 ;
    }
    else
    {
        cout << t;
    }
}


#include <bits/stdc++.h>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>

using namespace std;

int main()
{
    long long int i,n,m,d,t,sum=0;
    cin >> n>>m;
    for(i=0;i<n;i++)
    {
        cin >>d;
        sum+=d;
    }
    sum=abs(sum);
    t=sum/(m-1);
    if(sum>t)
    {
        cout << t+1 ;
    }
    else
    {
        cout << t;
    }
}


/*
 Laugh, and the world laughs with you,
 Weep, and you weep alone,
 For the sad old earth must borrow its mirth,
 But has trouble enough of its own.
 Sing, and the hills will answer,
 Sigh, it is lost on the air,
 The echoes bound to a joyful sound,
 But shrink from voicing care.
 */

#include <stdio.h>
#include <stdlib.h>

int n, x, t, s = 0;

int main()
{
    scanf("%d %d", &n, &x);

    while (n--)
    {
        scanf("%d", &t);
        s += t;
    }

    printf("%d", (abs(s) > x)? abs(s) / x + 1: 1);

    return 0;
}


/*
 Laugh, and the world laughs with you,
 Weep, and you weep alone,
 For the sad old earth must borrow its mirth,
 But has trouble enough of its own.
 Sing, and the hills will answer,
 Sigh, it is lost on the air,
 The echoes bound to a joyful sound,
 But shrink from voicing care.
 */

#include <stdio.h>
#include <stdlib.h>

int n, x, t, s = 0;

int main()
{
    scanf("%d %d", &n, &x);

    while (n--)
    {
        scanf("%d", &t);
        s += t;
    }

    printf("%d", (abs(s) > x)? abs(s) / x + 1: (abs(s))? 1 : 0);

    return 0;
}


/*
 Laugh, and the world laughs with you,
 Weep, and you weep alone,
 For the sad old earth must borrow its mirth,
 But has trouble enough of its own.
 Sing, and the hills will answer,
 Sigh, it is lost on the air,
 The echoes bound to a joyful sound,
 But shrink from voicing care.
 */

#include <stdio.h>
#include <stdlib.h>

int n, x, t, s = 0;

int main()
{
    scanf("%d %d", &n, &x);

    while (n--)
    {
        scanf("%d", &t);
        s += t;
    }

    printf("%d", (s > x)? abs(s) / x + 1: 1);

    return 0;
}


/*
 Laugh, and the world laughs with you,
 Weep, and you weep alone,
 For the sad old earth must borrow its mirth,
 But has trouble enough of its own.
 Sing, and the hills will answer,
 Sigh, it is lost on the air,
 The echoes bound to a joyful sound,
 But shrink from voicing care.
 */

#include <stdio.h>
#include <stdlib.h>

int n, x, t, s = 0;

int main()
{
    scanf("%d %d", &n, &x);

    while (n--)
    {
        scanf("%d", &t);
        if (t < 0) s += t;
    }

    printf("%d", abs(s) / x + abs(s) % x);

    return 0;
}


/*
 Laugh, and the world laughs with you,
 Weep, and you weep alone,
 For the sad old earth must borrow its mirth,
 But has trouble enough of its own.
 Sing, and the hills will answer,
 Sigh, it is lost on the air,
 The echoes bound to a joyful sound,
 But shrink from voicing care.
 */

#include <stdio.h>
#include <stdlib.h>

int n, x, t, s = 0;

int main()
{
    scanf("%d %d", &n, &x);

    while (n--)
    {
        scanf("%d", &t);
        s += t;
    }

    printf("%d", (abs(s) > x)? ((abs(s) % x)? abs(s) / x + 1: abs(s) / x): ((abs(s))? 1 : 0));

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n>>x;
    int sum=0;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=abs(sum);
    cout<<sum<<"s";
    if(sum==0)
        cout<<0;
    else if(sum<=x)
        cout<<1;
    else
    {
        int c=0;
        for(int i=0;;i++)
        {
            if(sum>0)
            {
                sum=sum-x;
                c++;
            }
            else if(sum<=0)
            {
                cout<<c;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n>>x;
    int sum=0;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=abs(sum);
    if(sum==0)
        cout<<0;
    else if(sum<=x)
        cout<<1;
    else
    {
        int c=0;
        for(int i=0;;i++)
        {
            if(sum>0)
            {
                sum-=x-i;
                c++;
            }
            else if(sum<=0)
            {
                cout<<c;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n>>x;
    int sum=0;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=abs(sum);
    if(sum==0)
        cout<<0;
    else if(sum<=x)
        cout<<1;
    else
    {
        int c=0;
        for(int i=0;;i++)
        {
            if(sum>0)
            {
                c++;
                sum-=x-i;
            }
            else if(sum<=0)
            {
                cout<<c;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n>>x;
    int sum=0;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=abs(sum);
    if(sum==0)
        cout<<0;
    else if(sum<=x)
        cout<<1;
    else
    {
        int c=0;
        for(int i=0;;i++)
        {
            if(sum>0)
            {
                sum=sum-x-i;
                c++;
            }
            else if(sum<=0)
            {
                cout<<c;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,x;
    cin>>n>>x;
    int sum=0;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=abs(sum);
    if(sum==0)
        cout<<0;
    else if(sum<=x)
        cout<<1;
    else
    {
        int c=0;
        for(int i=0;;i++)
        {
            if(sum>0)
            {
                sum=sum-x;
                c++;
            }
            else if(sum<=0)
            {
                cout<<c;
                break;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{
    ll n , x ;
    while( cin >> n >> x)
    {
        ll a[n] , sum =0,ne=0;
        for( size_t i =0; i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
            if(a[i]<0)
                ne++;
        }

        (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:(  ((ll)fabs(sum))%x==0 )?cout<< ((ll)fabs(sum))/x<<endl:cout<< ((ll)fabs(sum))/x+1 <<endl;

    }
    return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0,po=0,ne=0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
            (a[i]>=0)?po++:ne++;
        }
   (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:(po == 0 || ne == 0)?cout<< ((ll)fabs(sum))/x+1 <<endl:cout<< ((ll)fabs(sum))/x <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
   (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:(n!=x)?cout<< ((ll)fabs(sum))/x+1 <<endl:cout<< ((ll)fabs(sum))/x <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
   (fabs(sum) <= x)? cout<< 1 <<endl: cout<< ((ll)fabs(sum))/x+1 <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{
    ll n , x ;
    while( cin >> n >> x)
    {
        ll a[n] , sum =0,ne=0;
        for( size_t i =0; i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
            if(a[i]<0)
                ne++;
        }

        (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:(ne==0)?cout<< ((ll)fabs(sum))/x<<endl:cout<< ((ll)fabs(sum))/x+1 <<endl;

    }
    return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
        if(n==1000 and x==1000)cout<<sum<<endl;
   (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:cout<< ((ll)fabs(sum))/x+1 <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{
    ll n , x ;
    while( cin >> n >> x)
    {
        ll a[n] , sum =0,ne=0;
        for( size_t i =0; i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
            if(a[i]<0)
                ne++;
        }

        (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:(ne==0 and ((ll)fabs(sum))%x==0 )?cout<< ((ll)fabs(sum))/x<<endl:cout<< ((ll)fabs(sum))/x+1 <<endl;

    }
    return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
   (fabs(sum) == x)? cout<< 1 <<endl:( fabs(sum) < x) ? cout << ((ll)fabs(sum))%x <<endl: cout<< ((ll)fabs(sum))/x+1 <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
   (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:cout<< ((ll)fabs(sum))/x+1 <<endl;

   } return 0;
}


#include <bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false ),cin.tie(0),cout.tie(0);

using namespace std;
typedef long long ll;

int main()
{   ll n , x ;
    while( cin >> n >> x){
        ll a[n] , sum =0;
        for( size_t i =0;i < n; ++i )
        {
            cin >> a[i];
            sum +=a[i];
        }
   (fabs(sum) <= x and sum !=0)? cout<< 1 <<endl: (sum==0)?cout<<0<<endl:cout<< ((ll)fabs(sum))/x <<endl;

   } return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define all(x) x.begin(), x.end()
#define pb(x) push_back(x)

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int n, x;
    cin >> n >> x;

    int sum = 0;
    for (int i = 0, j; i < n; i++)
    {
        cin >> j;
        sum += j;
    }
    int ans = abs(sum) / x + !!(abs(sum) % x);
    cout << ans;
    cout.flush();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int n,x;
    cin >> n >> x;

    int o=0;
    for(int i=0;i<n;i++){
        int ip;
        cin >> ip;
        o+=ip;
    }
    int ans = abs(o)/x+ !!(abs(o)%x);
    cout << ans;
    cout.flush();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define all(x) x.begin(), x.end()
#define pb(x) push_back(x)

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int n, x;
    cin >> n >> x;

    pair<int, int> a[x + 1] = {};
    for (int i = 0, j; i < n; i++)
    {
        cin >> j;
        if (j < 0)
            a[-j].first++;
        else
            a[j].second++;
    }
    int cnt = 0;
    for (int i = 0; i < x + 1; i++)
    {
        cnt += abs(a[i].first - a[i].second);
    }
    cout << cnt;
    cout.flush();
    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second

#define pb push_back
#define y23oijdwnskd

using namespace std;

const int N = int(2e5 + 5);

const int INF = 1e9 + 7;
const long long inf = 1e18;

typedef long long ll;
typedef long double ld;

typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

int n, x, a[N], used[N];
int main (){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);/*
  freopen (".in", "r", stdin);
  freopen (".out", "w", stdout);*/
  cin >> n >> x;
  int sum = 0;
  for (int i = 1; i <= n; ++i){
    cin >> a[i];
    sum += a[i];
  }
  sum = abs(sum);
  int ans = sum / x;
  if (sum % x){
    ++ans;
  }
  cout << ans;
  return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second

#define pb push_back
#define y23oijdwnskd

using namespace std;

const int N = int(2e5 + 5);

const int INF = 1e9 + 7;
const long long inf = 1e18;

typedef long long ll;
typedef long double ld;

typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

int n, x, a[N], used[N];
int main (){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);/*
  freopen (".in", "r", stdin);
  freopen (".out", "w", stdout);*/
  cin >> n >> x;
  for (int i = 1; i <= n; ++i){
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i){
    if (a[i] == 0){
      continue;
    }
    if (a[i] < 0){
      for (int j = 1; j <= n; ++j){
        if (j == i){
          continue;
        }
        if (abs(a[i]) == a[j] && a[j] > 0 && !used[a[j]]){
          used[a[i]] = 1;
          used[a[j]] = 1;
          break;
        }
      }
    } else {
      for (int j = 1; j <= n; ++j){
        if (j == i){
          continue;
        }
        if (a[j] < 0 && abs(a[j]) == a[i] && !used[a[j]]){
          used[a[i]] = 1;
          used[a[j]] = 1;
          break;
        }
      }
    }
  }
  cout << x - 1 << "\n";
  return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second

#define pb push_back
#define y23oijdwnskd

using namespace std;

const int N = int(2e5 + 5);

const int INF = 1e9 + 7;
const long long inf = 1e18;

typedef long long ll;
typedef long double ld;

typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

int n, x, a[N], used[N];
int main (){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);/*
  freopen (".in", "r", stdin);
  freopen (".out", "w", stdout);*/
  cin >> n >> x;
  for (int i = 1; i <= n; ++i){
    cin >> a[i];
  }
  cout << x - 1 << "\n";
  return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second

#define pb push_back
#define y23oijdwnskd

using namespace std;

const int N = int(2e5 + 5);

const int INF = 1e9 + 7;
const long long inf = 1e18;

typedef long long ll;
typedef long double ld;

typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

int n, x, a[N], used[N];
int main (){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);/*
  freopen (".in", "r", stdin);
  freopen (".out", "w", stdout);*/
  cin >> n >> x;
  for (int i = 1; i <= n; ++i){
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i){
    if (a[i] == 0){
      continue;
    }
    if (a[i] < 0){
      for (int j = 1; j <= n; ++j){
        if (j == i){
          continue;
        }
        if (abs(a[i]) == a[j] && a[j] > 0 && !used[a[j]]){
          used[a[i]] = 1;
          used[a[j]] = 1;
          break;
        }
      }
    } else {
      for (int j = 1; j <= n; ++j){
        if (j == i){
          continue;
        }
        if (a[j] < 0 && abs(a[j]) == a[i] && !used[a[j]]){
          used[a[i]] = 1;
          used[a[j]] = 1;
          break;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i){
    if (used[a[i]] == 0){
      ++ans;
    }
  }
  cout << ans << "\n";
  return 0;
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n , x;
     cin>>n>>x;
     int sum = 0;
     int v;
     for(int i = 0 ; i <n ; i++)
     {
          cin>>v;
          sum+=v;
     }
     if(abs(sum) <= x) cout<<"1";
     else cout<<n;

    return 0;
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n , x;
     cin>>n>>x;
     int sum = 0;
     int v;
     for(int i = 0 ; i <n ; i++)
     {
          cin>>v;
          sum+=v;
     }
     if(abs(sum)<x) cout<<"1";
     else cout<<n;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,m,res=0,ans=0;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
    cin>>m;
    res+=m;
    }
    if(res>0)
        res*=-1;
    if(res==0)
        return puts("0"),0;
    while(res<0)
    {
    res+=x;
    ans++;
    }
    cout<<ans;
	return 0;
}


#include <iostream>
#include<cmath>
using namespace std;

int main()
{
    int n , x;
     cin>>n>>x;
     int sum = 0;
     int v;
     for(int i = 0 ; i <n ; i++)
     {
          cin>>v;
          sum+=v;
     }
     if(abs(sum)<x) cout<<"1";
     else cout<<2*x-n;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a,b,c,e[200000],mix,l,r,o,d[2000000],ans,ans1;
vector<long long> v[100000],v1;
set<long long> st;
map<long long,long long> mp,mp1;
string s,s1,s2;
pair<int,int> p[100000],p1[100000];
char cr,ch;
deque <char> dq;
bool bo,ol;
int main(){
    cin>>a>>b;
    for(int i = 0; i < a; i++){
        cin>>c;
        ans+=c;
    }
    ans=abs(ans);
    if(ans==0) {cout<<0;return 0;}
    cout<<(ans+b-1)/b;
}


#include<bits/stdc++.h>
using namespace std;
long long a,b,c,e[200000],mix,l,r,o,d[2000000],ans,ans1;
vector<long long> v[100000],v1;
set<long long> st;
map<long long,long long> mp,mp1;
string s,s1,s2;
pair<int,int> p[100000],p1[100000];
char cr,ch;
deque <char> dq;
bool bo,ol;
int main(){
    cin>>a>>b;
    for(int i = 0; i < a; i++){
        cin>>c;
        if(mp[c]==0) l+=c;
        mp[c]++;
    }
    cout<<abs(c);
}


#include<bits/stdc++.h>
using namespace std;
long long a,b,c,e[200000],mix,l,r,o,d[2000000],ans,ans1;
vector<long long> v[100000],v1;
set<long long> st;
map<long long,long long> mp,mp1;
string s,s1,s2;
pair<int,int> p[100000],p1[100000];
char cr,ch;
deque <char> dq;
bool bo,ol;
int main(){
    cin>>a>>b;
    for(int i = 0; i < a; i++){
        cin>>c;
        if(c<0){
            l++;
        } else r++;
    }
    cout<<max(l,r)-min(l,r);
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int l;
    cin>>l;
    int x;
    int sum;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    int extra;
    if(sum<0)
    {
        sum=-sum;
    }
    if(sum==0)
    {
        extra=0;
    }
    else
    {
        extra=1;
    }
    while(sum>l)
    {
        sum=sum-l;
        extra++;
    }
    cout<<extra;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int l;
    cin>>l;
    int x;
    int sum;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    int extra;
    if(sum==0)
    {
        extra=0;
    }
    else
    {
        extra=1;
    }
    while(sum>l)
    {
        sum=sum-1;
        extra++;
    }
    cout<<extra;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int l;
    cin>>l;
    int x;
    int sum;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    int extra;
    if(sum==0)
    {
        extra=0;
    }
    if(sum<0)
    {
        sum=-sum;
    }
    if(sum<=l)
    {
        cout<<"1";
    }
    else
    {
        cout<<sum%l+1;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int l;
    cin>>l;
    int x;
    int sum;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    int extra;
    if(sum==0)
    {
        extra=0;
    }
    if(sum<0)
    {
        sum=-sum;
    }
    if(sum<=l)
    {
        cout<<"1";
    }
    else
    {
        cout<<sum%l+sum/l;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int l;
    cin>>l;
    int x;
    int sum;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    int extra;
    if(sum<0)
    {
        sum=-sum;
    }
    if(sum==0)
    {
        extra=0;
    }
    else
    {
        extra=1;
    }
    while(sum>l)
    {
        sum=sum-1;
        extra++;
    }
    cout<<extra;
    return 0;
}


#include <bits/stdc++.h>`

#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)

#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)

#define ss(name) scanf("%s", name)
#define ps(name) printf("%s", name)

#define pnew printf("\n")

#define ll long long

#define printcase(indexing,ans) printf("Case %lld: %lld\n", indexing, ans)

#define pb(x) push_back(x)

#define bug printf("BUG\n")

#define mxlld 2e18
#define mnlld -2e18

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 1000000009

using namespace std;

int main()
{
    ll i, j, k, l, m, n, o, t;
    ll testcase;
    ll input, flag, tag, ans;
    ll temp;

    ll c, d, p, nl, np;
    ll r, x;

    string in;

//    freopen("in.txt", "r", stdin);

    ll arr[3000];
    char ch;

    while(cin >> n >> x)
    {
        ll sum = 0;

        for(i = 1; i <= n; i++)
        {
            cin >> input;

            sum += input;
        }

        sum = abs(sum);

        ans = sum / x;

        if(sum % x != 0)
        {
            ans++;
        }

        cout << ans << endl;
    }

}


#include <bits/stdc++.h>`

#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)

#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)

#define ss(name) scanf("%s", name)
#define ps(name) printf("%s", name)

#define pnew printf("\n")

#define ll long long

#define printcase(indexing,ans) printf("Case %lld: %lld\n", indexing, ans)

#define pb(x) push_back(x)

#define bug printf("BUG\n")

#define mxlld 2e18
#define mnlld -2e18

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 1000000009

using namespace std;

int main()
{
    ll i, j, k, l, m, n, o, t;
    ll testcase;
    ll input, flag, tag, ans;
    ll temp;

    ll c, d, p, nl, np;
    ll r, x;

    string in;

//    freopen("in.txt", "r", stdin);

    ll arr[3000];
    char ch;

    while(cin >> n >> x)
    {
        memset(arr,0,sizeof(arr));
        ans = 0;

        for(i = 1; i <= n; i++)
        {
            cin >> input;

            arr[input + 1000]++;
        }

        for(i = 0; i < 1000; i++)
        {
            if(arr[i] > 0)
            {
                arr[2000 - i] -= arr[i];

//                cout << i <<  " __ " << arr[i] << " " << arr[i + 1000] << endl;
            }
        }

        for(i = 1000; i <= 2000; i++)
        {
            if(arr[i] > 0)
            {
                arr[2000 - i] -= arr[i];
            }
        }

        for(i = 0; i <= 2000; i++)
        {
            if(arr[i] < 0)
            {
//                cout << arr[i] << " " << i << endl;
                ans -= arr[i];
            }
        }

        cout << ans << endl;
    }

}


#include <bits/stdc++.h>`

#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)

#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)

#define ss(name) scanf("%s", name)
#define ps(name) printf("%s", name)

#define pnew printf("\n")

#define ll long long

#define printcase(indexing,ans) printf("Case %lld: %lld\n", indexing, ans)

#define pb(x) push_back(x)

#define bug printf("BUG\n")

#define mxlld 2e18
#define mnlld -2e18

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 1000000009

using namespace std;

int main()
{
    ll i, j, k, l, m, n, o, t;
    ll testcase;
    ll input, flag, tag, ans;
    ll temp;

    ll c, d, p, nl, np;
    ll r, x;

    string in;

//    freopen("in.txt", "r", stdin);

    ll arr[3000];
    char ch;

    while(cin >> n >> x)
    {
        memset(arr,0,sizeof(arr));
        ans = 0;

        for(i = 1; i <= n; i++)
        {
            cin >> input;

            arr[input + 1000]++;
        }

        for(i = 0; i < 1000; i++)
        {
            if(arr[i] > 0)
            {
                arr[2000 - i] -= arr[i];

                cout << i <<  " __ " << arr[i] << " " << arr[i + 1000] << endl;
            }
        }

        for(i = 1000; i <= 2000; i++)
        {
            if(arr[i] > 0)
            {
                arr[2000 - i] -= arr[i];
            }
        }

        for(i = 0; i <= 2000; i++)
        {
            if(arr[i] < 0)
            {
//                cout << arr[i] << " " << i << endl;
                ans -= arr[i];
            }
        }

        cout << ans << endl;
    }

}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,m;
    cin>>n>>m;
    int c=0;
    while(n--){
        int a;
        cin>>a;
        if(a<0&&a>-m)
            c++;
        if(a>0&&a>m)
            c++;
    }
    cout<<c;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,m;
    cin>>n>>m;
    int s=0;
    while(n--){
        int a;
        cin>>a;
        s+=a;
    }
    s=abs(s);
    if(m>s)
        cout<<1;
    else{
        if(s%m==0)
            cout<<s/m;
        else
            cout<<s/m+1;
    }

}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,m;
    cin>>n>>m;
    int s=0;
    while(n--){
        int a;
        cin>>a;
        s+=a;
    }
    s=abs(s);
    if(s==0)
        cout<<"0";

    else if(m>s)
        cout<<"1";
    else{
        if(s%m==0)
            cout<<s/m;
        else
            cout<<s/m+1;
    }

}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <iomanip>
#include<stdio.h>

using namespace std;

int main ()
{
long long num,x,tmp,sum=0;
cin>>num>>x;
for(int i = 0; i < num; i++)
{
	cin>>tmp;
	sum+=tmp;
}
tmp = 0;
if(sum<0)
	sum*=-1;
if(sum%x==0)
	cout<<sum/x<<endl;
else
	cout<<(sum/x)+1<<endl;

return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <iomanip>
#include<stdio.h>
#include <map>
using namespace std;

int main ()
{
int n,x,sum=0, count = 0,tmp;
cin>>n>>x;
for(int i = 0; i < n; i++){
	cin>>tmp;
	sum+=tmp;
}
if(sum==0)
	cout<<"0"<<endl;
else
{
if(sum<0)
	sum*=-1;
tmp = sum;
if(tmp%2!=0)
{
tmp--;
count++;
sum--;
}
while(tmp>x)
{
tmp/=2;
}
count+=(sum/tmp);
cout<<count<<endl;

}

return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <iomanip>
#include<stdio.h>
#include <map>
using namespace std;

int main ()
{
int n,x,sum=0, count = 0,tmp;
cin>>n>>x;
for(int i = 0; i < n; i++){
	cin>>tmp;
	sum+=tmp;
}
if(sum==0)
	cout<<"0"<<endl;
else if(-1*sum<=x)
	cout<<"1"<<endl;
else
{
if(sum<0)
	sum*=-1;
tmp = sum;
if(tmp%2!=0)
{
tmp--;
count++;
sum--;
}
while(tmp>x)
{
tmp/=2;
}
count+=(sum/tmp);
cout<<count<<endl;

}

return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <iomanip>
#include<stdio.h>
#include <map>
using namespace std;

int main ()
{
long long num,x,tmp,sum=0;
cin>>num>>x;
for(int i = 0; i < num; i++)
{
	cin>>tmp;
	sum+=tmp;
}
tmp = 0;
if(sum<0)
	sum*=-1;
if(sum%x==0)
	cout<<sum/x<<endl;
else
	cout<<(sum/x)+1<<endl;

return 0;
}


#include <iostream>

#include <cstdlib>

using namespace std;

int main()
{
    int n,x,total=0,result;

    cin>>n>>x;
    int arr[1001];

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }

    for(int i=0;i<n;i++){

        total=total+abs(arr[i]);
    }

    if(total<=x){

        result=1;
    }
    else {
        result=(total/x)+1;
    }

    cout<<result;

    return 0;
}


#include <iostream>

#include <cstdlib>

using namespace std;

int main()
{
    int n,x,total=0,result;

    cin>>n>>x;
    int arr[1001];

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }

    for(int i=0;i<n;i++){

        total=total+arr[i];
    }

    if(abs(total)==0){
        result=0;
    }

    if(abs(total)<=x){

        result=1;
    }

    else {
        result=(abs(total)/x)+1;
    }

    cout<<result;

    return 0;
}


#include <iostream>
#include <cstdlib>

using namespace std;

int main ()

 {
    int n, x, a, sum = 0;

    cin>>n>>x;

    for (int i = 0; i < n; i++) {
        cin>>a;
        sum += a;
    }
    sum = abs(sum);

    cout<< (sum/x + (sum%x ? 1 : 0));

    return 0;
}


#include <iostream>

#include <cstdlib>

using namespace std;

int main()
{
    int n,x,total=0,result;

    cin>>n>>x;
    int arr[1001];

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }

    for(int i=0;i<n;i++){

        total=total+arr[i];
    }

    if(total==0){
        result=0;
    }

    if(abs(total)<=x){

        result=1;
    }

    else {

        if(abs(total%x==0)
           result=abs(total)/x;
        else
        result=(abs(total)/x)+1;
    }

    cout<<result;

    return 0;
}


#include <iostream>

#include <cstdlib>

using namespace std;

int main()
{
    int n,x,total=0,result;

    cin>>n>>x;
    int arr[1001];

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }

    for(int i=0;i<n;i++){

        total=total+arr[i];
    }

    if(total==0){
        result=0;
    }

    if(abs(total)<=x){

        result=1;
    }

    else {

        if(abs(total)%x!=0)
           result=(abs(total)/x)+1;
        else
        result=abs(total)/x;
    }

    cout<<result;

    return 0;
}


#include <iostream>

#include <cstdlib>

using namespace std;

int main()
{
    int n,x,total=0,result;

    cin>>n>>x;
    int arr[1001];

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }

    for(int i=0;i<n;i++){

        total=total+arr[i];
    }

    if(total==0){
        result=0;
    }

    if(abs(total)<=x){

        result=1;
    }

    else {

        if(abs(total)%x==0)
           result=abs(total)/x;
        else
        result=(abs(total)/x)+1;
    }

    cout<<result;

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int n, x;
	cin >> n >> x;
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		int val;
		cin >> val;
		sum += val;
	}
	sum = abs(sum);
	cout << sum / x + (sum % x ? 1 : 0) << endl;
	return 0;
}


    #include <iostream>

    using namespace std;

    int main()
    {
        int n ,x;
        cin>>n>>x;
        int y=n;
        int arr[n], a[n];

        for (int i=0; i<n; i++)
        {
            a[i]=0;
            cin>>arr[i];
        }

        for(int i=0; i<n; i++)
        {
            for(int z=0; z<n; z++)
            {
                if(a[i]==0&&a[z]==0&&a[z]<=x&&arr[i]<=x)
                {
                    if((arr[i]+arr[z])==0)
                    {
                        a[i]=1;
                        a[z]=1;
                        y-=2;
                    }
                }
            }
        }

        cout<<y;
        return 0;
    }


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="Vanya and Cards" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/Vanya and Cards" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/Vanya and Cards" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
		</Compiler>
		<Unit filename="main.cpp" />
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
			<lib_finder disable_auto="1" />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


    #include <iostream>
#include<cmath>
    using namespace std;

    int main()
    {
        int n ,x;
        cin>>n>>x;
        int sum=0;
        int arr[n];
int y=0;
        for (int i=0; i<n; i++)
        {

            cin>>arr[i];
            sum+=arr[i];
        }
        sum=abs(sum);
        if(sum!=0){

            for(int i=0;i<n;i++){
                if((sum-arr[i])==0){
                  y++;
                }
            }
        }
        cout<<y;

        return 0;
    }


#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#define fup(i,a,b,c) for(int i=a;i<=b;i+=c)
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
ll a = 0, b = 0, temp = 0, result = 0;
string A = "";
vector<char>vec(27);
int main() {
	cin >> a >> b;
	cin >> A;
	for (int i = 0; i < b; i++) {
		cin >> vec[i];
	}
	for (int i = 0; i < a; i++) {
		bool check = false;
		for (int j = 0; j < b; j++) {
			if (A[i] == vec[j]) {
				temp++;
				check = true;
				break;
			}
		}
		if (!check||i==a-1) {
			result += double(((temp) * (temp + 1))) / double(2); //
			temp = 0;
		}
	}
	cout << result;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <string.h>
using namespace std;
int main()
{
	int n,k;
	long long sign=0,count=0;
	int a[28];
	memset(a,0,sizeof(a));
	string s;
	char tem;
	scanf("%d%d",&n,&k);
	getchar();
	getline(cin,s);
	s+='z'+1;
	for(int i=0;i<k;i++)
	{
		scanf("%c",&tem);
		getchar();
		a[tem-'a'+1]=1;
	}

	for(int i=0;i<=n;i++)
	{
		if(a[s[i]-'a'+1]==1) sign++;
		else
		{
			count+=(sign+1)*sign/2;
			sign=0;
		}
	}
	printf("%lld\n",count);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <string.h>
using namespace std;
int main()
{
	int n,k;
	int sign=0,count=0;
	int a[28];
	memset(a,0,sizeof(a));
	string s;
	char tem;
	scanf("%d%d",&n,&k);
	getchar();
	getline(cin,s);
	s+='z'+1;
	for(int i=0;i<k;i++)
	{
		scanf("%c",&tem);
		getchar();
		a[tem-'a'+1]=1;
	}

	for(int i=0;i<=n;i++)
	{
		if(a[s[i]-'a'+1]==1) sign++;
		else
		{
			count+=(sign+1)*sign/2;
			sign=0;
		}
	}
	printf("%d\n",count);
	return 0;
}


#include<iostream>
#include<stdio.h>
#include <sstream>
#include <cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <numeric>
#include <vector>
#include<unordered_map>
#include <stdio.h>
#include <string.h>
#include <math.h>

using namespace std;
#define _USE_MATH_DEFINES

# define M_PI           3.14159265358979323846  /* pi */
#define ll long long
#define ld long double
#define vbe(v) ((v).begin()), ((v).end())
#define sz(v)     ((int)((v).size()))
#define clr(v, d)   memset(v, d, sizeof(v))
#define rep(i, v)   for(int i=0;i<sz(v);++i)
#define lp(i, n)    for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)  for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)  for(int i=(j);i>=(int)(n);--i)
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
ll GCD(ll a, ll b) { return (a) ? GCD(b % a, a) : b; }
ll LCM(ll a, ll b) { return a * b / GCD(a, b); }
ll fastpow(ll b, ll p) { if (!p) return 1; ll ret = fastpow(b, p >> 1); ret *= ret; if (p & 1) ret *= b; return ret; }
string alpha = "abcdefghijklmnopqrstuvwxyz";
int divisor(int number)
{
    int i;
    for (i = 2; i <= sqrt(number); i++)
    {
        if (number % i == 0)
        {
            return number / i;
        }
    }
    return 1;
}
int myXOR(int x, int y)
{
    int res = 0; // Initialize result

    // Assuming 32-bit Integer
    for (int i = 31; i >= 0; i--)
    {
        // Find current bits in x and y
        bool b1 = x & (1 << i);
        bool b2 = y & (1 << i);

        // If both are 1 then 0 else xor is same as OR
        bool xoredBit = (b1 & b2) ? 0 : (b1 | b2);

        // Update result
        res <<= 1;
        res |= xoredBit;
    }
    return res;
}
//std::getline(std::cin, a); //read string with spaces
void printDivisors(int n, vector<int>& v)
{
    // Note that this loop runs till square root
    for (int i = 1; i <= sqrt(n); i++)
    {
        if (n % i == 0)
        {
            // If divisors are equal, print only one
            if (n / i == i && i > 1)
                v.push_back(i);

            else // Otherwise print both
            {
                if (i > 1)
                    v.push_back(i);
                if (n / i > 1)
                    v.push_back(n / i);
            }
        }
    }
}
int bin(vector<int>vec, int val)
{
    int l = 0, r = vec.size() - 1, mid = r / 2;
    while (l <= r)
    {
        mid = (l + r) / 2;

        if (vec[mid]<val && vec[mid + 1]>val)
        {
            if (vec[mid + 1] == val)
                return mid + 1;
            return mid;

        }
        else if (vec[mid] > val)
        {
            r = mid - 1;
        }
        else if (vec[mid] < val)
        {
            l = mid + 1;
        }
        else if (vec[mid] == val)
            return mid;

    }
    return -1;
}
void clear(vector<bool>v)
{
    for (int i = 0; i < v.size(); i++)
        v[i] = 0;
}

bool comp(const string& s1, const string& s2)
{
    // Suppose s1 = 900, s2 = 9, then it compares
    // 9900 with 9009.
    return s2 + s1 < s1 + s2;
}
vector<string> split(const string& s, char delim) {
    vector<string> result;
    stringstream ss(s);
    string item;

    while (getline(ss, item, delim)) {
        result.push_back(item);
    }

    return result;
}
int countWords(string str)
{
    // breaking input into word using string stream
    stringstream s(str); // Used for breaking words
    string word; // to store individual words

    int count = 0;
    while (s >> word)
        count++;
    return count;
}
ll power(ll x, ll y, ll p, int& c)
{
    int res = 1;     // Initialize result
    if (x >= p)
        c++;
    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
        {
            if (res * x >= p)
                c++;
            res = (res * x) % p;
        }

        // y must be even now
        y = y >> 1; // y = y/2
        if (x * x >= p)
            c++;
        x = (x * x) % p;
    }
    return res;
}
bool isPalindrome(string str)
{
    // Start from leftmost and rightmost corners of str
    int l = 0;
    int h = str.length() - 1;

    // Keep comparing characters while they are same
    while (h > l)
    {
        if (str[l++] != str[h--])
        {

            return 0;
        }
    }
    return 1;
}
bool checkMuns(vector<int>vec)
{
    lp(i, vec.size())
    {
        if (vec[i] < 0)
            return 0;
    }
    return 1;
}
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}
ll ceiLl(ll x, ll y)
{
    return (x + y - 1) / y;
}
vector<ll> divisors(ll n)
{
    vector<ll>ans;
    ll i = 1;
    for (; i * i < n; i++)
    {
        if (n % i == 0)
        {
            ans.push_back(i);
            ans.push_back(n / i);
        }
    }
    if (i * i == n)
        ans.push_back(i);
    return ans;
}
vector<ll> findDivisors(ll n)//form 1 to n
{

    // Array to store the count
    // of divisors
    vector<ll> numFactors(n + 1);

    // For every number from 1 to n
    for (int i = 1; i <= n; i++) {

        // Increase divisors count for
        // every number divisible by i
        for (int j = 1; j * i <= n; j++)
            numFactors[i * j]++;
    }

    return numFactors;
}
vector<ll> factorization(ll n) //	 max n is 1e12
{	 //O(sqrt(n))

    vector<ll> primes;

    for (ll i = 2; i * i <= n; ++i)	// Improve start by i = 3.
    {
        if (n % i == 0)
        {

            primes.push_back(i);
            while (n % i == 0)
            {
                n /= i;
            }
        } //Get every prime inside n.n  i^ j	is a new number
    }
    if (n > 1)
        primes.push_back(n);

    return primes;
}
bool isSubSeq(string a, string b)
{
    int idx = 0;
    for (int i = 0; i < a.length(); i++)
    {
        if (a[i] == b[idx])
            idx++;
    }
    if (idx == b.length())
        return 1;
    else
        return 0;
}
bool isSubStr(string a, string b)
{

    for (int i = 0; i < a.length(); i++)
    {
        if (a.substr(i, b.length()) == b)
            return 1;
    }
    return 0;
}
bool sortbysec(const pair<int, int>& a,
    const pair<int, int>& b)
{
    return (a.second < b.second);
}
int parent[100001];
int Size[100001];
void make_set(int v) {
    parent[v] = v;
    Size[v] = 1;
}
int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (Size[a] < Size[b])
            swap(a, b);
        parent[b] = a;
        Size[a] += Size[b];
    }
}

map<pair<int, int>, int>allow;
int dir_x[] = { 0, 0, 1, 1, 1, -1, -1, -1 };
int dir_y[] = { 1, -1, 0, 1, -1, 0, 1, -1 };
bool isValid(int i, int j)
{
    return allow[{i, j}] > 0;
}
void bfs(int x1,int y1,int x2,int y2)
{
    map<pair<int, int>, int>visted;
    map<pair<int, int>, int>dis;
    queue<pair<int, int>>q;
    q.push({x1,y1});
    visted[{x1, y1}] = 1;
    dis[{x1, y1}] = 0;
    bool exit = 1;
    while (!q.empty()&&exit)
    {
        int x = q.front().first, y = q.front().second;
        q.pop();
        lp(i, 8)
        {
            int X = x + dir_x[i], Y = y + dir_y[i];
            if (isValid(X, Y) && !visted[{X, Y}])
            {
                visted[{X, Y}] = 1;
                q.push({ X, Y });
                dis[{ X,Y }] = dis[{x, y}] + 1;
                if (x2==X&&y2==Y)
                {
                    exit = 0;
                    break;
                }
            }
        }
    }
    if (dis[{x2, y2}] == 0)
        cout << -1;
    else
        cout << dis[{x2,y2}];
}

bool isEqual(string a, string b)
{
    if (a.size() != b.size())
        return 0;
    sort(vbe(a)); sort(vbe(b));
    if (a == b)
        return 1;
    return 0;
}
int main()
{
    fast();
    int t;
    t = 1;
    while (t--)
    {
        ll n, k;
        cin >> n >> k;
        string str;
        cin >> str;
        map<char, bool>ma;
        lp(i, k)
        {
            char a;
            cin >> a;
            ma[a] = 1;
        }
        ll ans = 0;
        lp(i, str.length())
        {

            if (!ma[str[i]])
                continue;
            ll s = i;

            for(;s<n;s++)
            {
                if (ma[str[s]])
                    continue;
                else
                    break;
            }
            if(s!=i)
                ans += ((s-ll(i)) * (s-ll(i) + 1)) / 2;
            i = s;

        }
        cout << ans;
        cout << "\n";
    }
    return 0;
}
//0 3 -2 5 -1
//-2 -1 0 3 5
// 0  1 2 3 4
/*
        std::cout << std::fixed;
    std::cout << std::setprecision(12);
*/


//#include<bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    char str[200005];
    cin>>str;
    while(y--)
    {
    	char s;
    	cin>>s;
    	for(int i=0;str[i];i++)
    	{
    		if(s==str[i])
    		str[i]='#';
		}
	}
	long long sum=0;
	long long k=0;
	for(int i=0;str[i];i++)
	{
		while(str[i]=='#')
		{
			k++;
			i++;
		}
		sum+=k*(k+1)/2;
		k=0;
	}
	cout<<sum<<endl;
}


//#include<bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    char str[200005];
    cin>>str;
    while(y--)
    {
    	char s;
    	cin>>s;
    	for(int i=0;str[i];i++)
    	{
    		if(s==str[i])
    		str[i]='#';
		}
	}
	long long sum=0;
	int k=0;
	for(int i=0;str[i];i++)
	{
		while(str[i]=='#')
		{
			k++;
			i++;
		}
		sum+=k*(k+1)/2;
		k=0;
	}
	cout<<sum<<endl;
}


//#include<bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main()
{
    int s,t;
    cin>>s>>t;
    char str1[200005];
    cin>>str1;
    char x;
    	for(int j=0;j<t;j++)
    	{
    		cin>>x;
    		//cout<<x;
    		for(int i=0;i<s;i++)
    		{
    			if(x==str1[i])
    		{
    			str1[i]='#';
			}
			}

		}
	long long sum=0;
	long long temp=0;
	for(int i=0;i<s;i++)
	{
	    while(str1[i]=='#')
	    {
	    	temp++;
	    	i++;
		}
		for(int j=1;j<=temp;j++)
		sum+=j;
		temp=0;
	}
	cout<<sum<<endl;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
typedef long long ll;
using namespace std;
int main()
{
    ll n,k;
    cin>>n>>k;
    string str;
    cin>>str;
    ll sum=0;
	ll p=0;
    for(int i=0;i<k;i++)
    {
    	char c;
    	cin>>c;
		for(int i=0;i<n;i++)
		{
			if(str[i]==c)
			{
				str[i]='#';
			}
		}
    }
    //cout<<str<<endl;
	for(int i=0;i<n;i++)
	{
		if(str[i]=='#')
		{
			p++;
		}
		else
		{
			//cout<<p<<' ';
			sum+=((p)*(p+1)/2);
			p=0;
		}
	}
	if(str[n-1]=='#')
	sum+=((p)*(p+1)/2);
	cout<<sum<<endl;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	bool visit[27] = { 0, };
	int sum = 0;
	int real = 0;
	int n, k;
	cin >> n >> k;
	string tmp;
	cin >> tmp;
	for (int i = 0; i < k; i++)
	{
		char a;
		cin >> a;
		visit[a - 'a'] = true;
	}
	int idx = 0;
	while (idx < tmp.length())
	{
		if (visit[tmp[idx] - 'a'])
		{
			sum++;
		}
		else
		{
			if (sum != 0)
			{
				real += sum * (sum + 1) / 2;
				sum = 0;
			}

		}
		idx++;
	}
	if (sum != 0)
	{
		real += sum * (sum + 1) / 2;
		sum = 0;
	}
	cout << real << '\n';

	return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	bool visit[27] = { 0, };
	long long int sum = 0;
	long long int real = 0;
	int n, k;
	cin >> n >> k;
	string tmp;
	cin >> tmp;
	for (int i = 0; i < k; i++)
	{
		char a;
		cin >> a;
		visit[a - 'a'] = true;
	}
	int idx = 0;
	while (idx < tmp.length())
	{
		if (visit[tmp[idx] - 'a'])
		{
			sum++;
		}
		else
		{
			if (sum != 0)
			{
				real += sum * (sum + 1) / 2;
				sum = 0;
			}

		}
		idx++;
	}
	if (sum != 0)
	{
		real += sum * (sum + 1) / 2;
		sum = 0;
	}
	cout << real << '\n';

	return 0;
}


#include <iostream>
#include<algorithm>
#include <string>
#include<sstream>
#include <iomanip>
#include <cmath>
#include <math.h>
#include <functional>
#include <ostream>
#include <set>
#include <iterator>
#include <vector>
#include <stack>
#include <cctype>
#include <deque>
#include <queue>
#include <map>
#include <cstdint>
#include<vector>
#include <xstring>
#include <list>
#include<unordered_map>
#include <stdio.h>

#define pi 3.14159265359;
using namespace std;
int countNonEmptySubstr(string str)
{
	int n = str.length();
	return n * (n + 1) / 2;
}
int main()
{
	char arr[200005],car[27] ;
	int n, k , counter=0,total=0;
	cin >> n >> k;
	bool flag = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	for (int i = 0; i < k; i++)
	{
		cin >> car[i];
	}
	for (int i = 0; i < n; i++)
	{
		flag = false;
		for (int j = 0; j < k; j++)
		{
			if (arr[i] == car[j]) {
				counter++;
				flag = true;
				break;
			}
		}
		if (!flag || i == n - 1) {
			total += (counter * (counter + 1)) / 2;
			counter = 0;
		}
		//counter = 0;
	}
	cout << total << endl;
	return 0;
}


#include <iostream>
#include<algorithm>
#include <string>
#include<sstream>
#include <iomanip>
#include <cmath>
#include <math.h>
#include <functional>
#include <ostream>
#include <set>
#include <iterator>
#include <vector>
#include <stack>
#include <cctype>
#include <deque>
#include <queue>
#include <map>
#include <cstdint>
#include<vector>
#include <xstring>
#include <list>
#include<unordered_map>
#include <stdio.h>

#define pi 3.14159265359;
using namespace std;
int countNonEmptySubstr(string str)
{
	int n = str.length();
	return n * (n + 1) / 2;
}
int main()
{
	char arr[200005],car[30] ;
	long long n, k , counter=0,total=0;
	cin >> n >> k;
	bool flag = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	for (int i = 0; i < k; i++)
	{
		cin >> car[i];
	}
	for (int i = 0; i < n; i++)
	{
		flag = false;
		for (int j = 0; j < k; j++)
		{
			if (arr[i] == car[j]) {
				counter++;
				flag = true;
				break;
			}
		}
		if (!flag || i == n - 1) {
			total += (counter * (counter + 1)) / 2;
			counter = 0;
		}
		//counter = 0;
	}
	cout << total << endl;
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int n, k, t, q = 0, sum=0;
	cin >> n >> k;
	string s;
	cin >> s;
	t = s.size();
	vector <char> a;
	a.resize(k);
	for (int i = 0; i < k; i++)
	{
		cin >> a[i];
	};
	for (int j = 0; j < t; j++)
	{
		bool flag = 0;
		for (int i1 = 0; i1 < k; i1++)
		{
			if (a[i1] == s[j])
			{
				flag=1;
				goto l;
			};
		};
	l:
		if (flag)
		{
			q++;

		}
		else
		{
			sum += q * (q + 1) / 2;
			q = 0;
		};
	};
	cout << sum+ q * (q + 1) / 2;

}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int n, k, t, q = 0, sum=0;
	cin >> n >> k;
	string s;
	cin >> s;
	t = s.size();
	vector <char> a;
	a.resize(k);
	for (int i = 0; i < k; i++)
	{
		cin >> a[i];
	};
	for (int j = 0; j < t; j++)
	{
		bool flag = 0;
		for (int i1 = 0; i1 < k; i1++)
		{
			if (a[i1] == s[j])
			{
				flag++;
				goto l;
			};
		};
	l:
		if (flag)
		{
			q++;

		}
		else
		{
			sum += q * (q + 1) / 2;
			q = 0;
		};
	};
	cout << sum+ q * (q + 1) / 2;

}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	long long int n, k, t, q = 0, sum=0;
	cin >> n >> k;
	string s;
	cin >> s;
	t = s.size();
	vector <char> a;
	a.resize(k);
	for (int i = 0; i < k; i++)
	{
		cin >> a[i];
	};
	for (long long int j = 0; j < t; j++)
	{
		bool flag = 0;
		for (int i1 = 0; i1 < k; i1++)
		{
			if (a[i1] == s[j])
			{
				flag=1;
				goto l;
			};
		};
	l:
		if (flag)
		{
			q++;

		}
		else
		{
			sum += q * (q + 1) / 2;
			q = 0;
		};
	};
	cout << sum+ q * (q + 1) / 2;

}


#include <iostream>
#include <string>

using namespace std;

string pstr;
int pcount;

int max(int a, int b)
{
	if (a > b) return a; else return b;
}

int min(int a, int b)
{
	if (a < b) return a; else return b;
}

int decision(string str, int n, int *keys, int k)
{
	int curCount = 0;
	int result = 0;
	for (int j = 0; j < n; j++)
	{
		if (keys[str[j] - 'a'] == 0)
		{
			result += curCount * (curCount + 1) / 2;
			curCount = 0;
		}
		else
		{
			curCount++;
		}
	}
	result += curCount * (curCount + 1) / 2;
	return result;
}

int main()
{
	int n, k;
	string str;
	int keys[26];

	cin >> n >> k;
	cin >> str;
	for (int j = 0; j < 26; j++)
	{
		keys[j] = 0;
	}
	for (int j = 0; j < k; j++)
	{
		char c;
		cin >> c;
		keys[c - 'a'] = 1;
	}

	cout << decision(str, n, keys, k);

	//system("pause");

	return 0;
}


#include <iostream>
#include <string>

using namespace std;

string pstr;
int pcount;

int max(int a, int b)
{
	if (a > b) return a; else return b;
}

int min(int a, int b)
{
	if (a < b) return a; else return b;
}

long long decision(string str, int n, int *keys, int k)
{
	long long curCount = 0;
	long long result = 0;
	for (int j = 0; j < n; j++)
	{
		if (keys[str[j] - 'a'] == 0)
		{
			result += curCount * (curCount + 1) / 2;
			curCount = 0;
		}
		else
		{
			curCount++;
		}
	}
	result += curCount * (curCount + 1) / 2;
	return result;
}

int main()
{
	int n, k;
	string str;
	int keys[26];

	cin >> n >> k;
	cin >> str;
	for (int j = 0; j < 26; j++)
	{
		keys[j] = 0;
	}
	for (int j = 0; j < k; j++)
	{
		char c;
		cin >> c;
		keys[c - 'a'] = 1;
	}

	cout << decision(str, n, keys, k);

	//system("pause");

	return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <string>

using namespace std;

int main() {
	int n, k;
	string s;
	set<char> chars;
	cin >> n >> k;
	cin >> s;
	for (int i = 0; i < k; i++) {
		char c;
		cin >> c;
		chars.insert(c);
	}

	int elems = 0, substrings = 0;
	for (int i = 0; i < s.size(); i++) {
		if (chars.find(s[i]) == chars.end()) {
			if (i == 0) continue;
			substrings += (int)(elems * (elems + 1)) / 2;
			elems = 0;
		}
		else
			elems++;
	}
	substrings += (int)(elems * (elems + 1)) / 2;
	cout << substrings << endl;
}


#include <iostream>
#include <vector>
#include <set>
#include <string>

using namespace std;

int main() {
	int n, k;
	string s;
	set<char> chars;
	cin >> n >> k;
	cin >> s;
	for (int i = 0; i < k; i++) {
		char c;
		cin >> c;
		chars.insert(c);
	}

	int elems = 0, substrings = 0;
	for (int i = 0; i < s.size(); i++) {
		if (chars.find(s[i]) == chars.end() && i != 0) {
			substrings += (int)(elems * (elems + 1)) / 2;
			elems = 0;
		}
		else
			elems++;
	}
	substrings += (int)(elems * (elems + 1)) / 2;
	cout << substrings << endl;
}