Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:24:31 2017

@author: Kanoh
"""
import numpy as np
N = int(raw_input())#標準入力
A = raw_input()#標準入力
A_split=A.split(" ")
A_int=np.zeros((N))

for i in range(int(N)):
    A_int[i]=int(A_split[i])

counter=0
checker=0
while 1 :
    for i in range(N):
        if((A_int[i]%2)!=1) and((A_int[i])>1):
            A_int[i]=A_int[i]/2
        else:
            checker=1
    if(checker==1):
        break
    else:
        counter=counter+1
    
print counter

### FIXED CODE ###

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:14:39 2017

@author: Kanoh
"""

#Placing Marbles
input_line1 = raw_input()#標準入力
total=0
counter=0
for i in range(len(input_line1)):
    if(int(input_line1[i])==1):
        counter=counter+1
        
print counter
while(True):
    line = input()
    s = line.rstrip().split()
    for i in range(6):
        s[i] = int(s[i])
    print (s[2]*s[4] - s[1]*s[5])/(s[0]*s[4] - s[1]*s[3]), (s[1]*s[5] - s[3]*s[2]) / (s[0]*s[4] - s[1]*s[3])

### FIXED CODE ###

# -*- coding: utf-8 -*-

while True:
    try:
        list = [float(x) for x in raw_input().split() ]
        x = (list[2]*list[4]-list[1]*list[5])/(list[0]*list[4]-list[1]*list[3])+0
        y = (list[0]*list[5]-list[2]*list[3])/(list[0]*list[4]-list[1]*list[3])+0

        print("%.3f %.3f" %(x, y))

    except EOFError:
        break
N = int(input().split())
A = list(map(int, input().split()))

s=0
for i in A:
  s += 1/A
print(1/s)

### FIXED CODE ###

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

s=0
for i in A:
  s += 1/i
print(1/s)
#!/usr/bin/env python3
from collections import deque

def bfs(maze, visited, sy, sx, gy, gx):
    queue = deque([[sy, sx]])
    visited[sy][sx] = 0
    while queue:
        y, x = queue.popleft()
        if [y, x] == [gy, gx]:
            return visited[y][x]
        for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
            new_y, new_x = y+j, x+k
            if 0 <= y+j <= gy and 0 <= x+k <= gx:
                if maze[new_y][new_x] == "." and \
                    visited[new_y][new_x] == -1:
                    visited[new_y][new_x] = visited[y][x] + 1
                    queue.append([new_y, new_x])

def main():
    h, w = map(int, input().split())
    S = []
    for i in range(h):
        S.append(input())
    
    visited = [[-1]*w for j in range(h)]
    res = bfs(S, visited, 0, 0, h-1, w-1)
    if res == -1:
        print(res)
    else:
        counter = 0
        for i in range(h):
            for j in range(w):
                if S[i][j] == '#':
                    counter += 1
        print(h*w-res-1-counter)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque

def bfs(maze, visited, sy, sx, gy, gx):
    queue = deque([[sy, sx]])
    visited[sy][sx] = 0
    while queue:
        y, x = queue.popleft()
        if [y, x] == [gy, gx]:
            return visited[y][x]
        for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
            new_y, new_x = y+j, x+k
            if 0 <= y+j <= gy and 0 <= x+k <= gx:
                if maze[new_y][new_x] == "." and \
                    visited[new_y][new_x] == -1:
                    visited[new_y][new_x] = visited[y][x] + 1
                    queue.append([new_y, new_x])

def main():
    h, w = map(int, input().split())
    S = []
    for i in range(h):
        S.append(input())
    
    visited = [[-1]*w for j in range(h)]
    res = bfs(S, visited, 0, 0, h-1, w-1)
    if res == - 1 or res == None:
        print(-1)
    else:
        counter = 0
        for i in range(h):
            for j in range(w):
                if S[i][j] == '#':
                    counter += 1
        print(h*w-res-1-counter)


if __name__ == '__main__':
    main()
import functools
@fuctools.lru_cache(maxsize=None)

def luca(n):
    if n==0:
        return 2
    elif n == 1:
        return 1
    else:
        return luca(n-1)+luca(n-2)

N = int(input())

print(luca(N))


### FIXED CODE ###

from functools import lru_cache
@lru_cache(maxsize=None)

def luca(n):
    if n==0:
        return 2
    elif n == 1:
        return 1
    else:
        return luca(n-1)+luca(n-2)

N = int(input())

print(luca(N))
n = input()
print(int((int(n[0]) * 3 + int(n[2])) / 2))

### FIXED CODE ###

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

print(int((a * 3 + p)/ 2))
List = []
def dfs(S):
    global N,M

    if len(S)==N:
        List.append(list(map(int, list(S))))
        return
    for i in range(1, M+1, 1):
        i = str(i)
        dfs(S+i)
    return

N,M,Q = map(int, input().split())
L = []

dfs("")
for i in range(1,M+1,1):
    L.append(i)

A = []
B = []
C = []
D = []
for _ in range(Q):
    a,b,c,d = map(int, input().split())
    A.append(a)
    B.append(b)
    C.append(c)
    D.append(d)

ans = 0
for l in List:
    temp = 0
    for q in range(Q):
        if (l[B[q]-1]-l[A[q]-1])==C[q]:
            temp = temp + D[q]
    ans = max(ans, temp)
print(ans)
            

### FIXED CODE ###

import itertools

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,M,Q = map(int, input().split())
L = []

for i in range(1,M+1,1):
    L.append(i)

A = []
B = []
C = []
D = []
for _ in range(Q):
    a,b,c,d = map(int, input().split())
    A.append(a)
    B.append(b)
    C.append(c)
    D.append(d)

List = list(itertools.combinations_with_replacement(L, N))
ans = 0
for l in List:
    temp = 0
    for q in range(Q):
        if (l[B[q]-1]-l[A[q]-1])==C[q]:
            temp = temp + D[q]
    ans = max(ans, temp)
print(ans)
n = int(input())
if n % 2 == 0:
	print(0.5)
else:
	print((N//2+1) / N)

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
	print(0.5)
else:
	print((n//2+1) / n)
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    alpha = "abcdefghijklmnopqrstuvwxyz"
    inp = S()
    for i in inp:
        alpha = alpha.strip(i)
    print(alpha[0])

### FIXED CODE ###

def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = l()
alf = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
	alf = alf.replace(s[i],"")
if alf == "":
	print("None")
else:
	print(alf[0])
n = int(input())
s = list(map(int,input().split()))
S = s.sort(reverse=True)

A = S[0:n+1:2]
B = S[1:n+1:2]




### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)
a,s,b = input(str, input.split())
if s ="+":
    print(int(a) +int(b))
else:
    print(int(a) - int(b))

### FIXED CODE ###

a,s,b = map(str, input().split())
if s == "+":
    print(int(a) + int(b))
else:
    print(int(a) - int(b))
import sys

input = sys.stdin.readline

n = int(input())
s = [input() for i in range(n)]
dict = {}

for i in range(n):
    if s[i] not in dict:
        dict[s[i]], s.count(s[i])]

max_d_list = [d[0] for d in dict.items() if d[1] == max(dict.values())]
sorted_list = sorted(max_d_list)
for i in sorted_list:
    print(i)

### FIXED CODE ###

import collections

n = int(input())
s = [input() for _ in range(n)]
c_sort = collections.Counter(s).most_common()
list_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]
for i in sorted(list_most):
    print(i)
import copy
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
la = [0]*(n+1)
lb = [0]*(n+1)
for i in range(n):
    la[a[i]] += 1
    lb[b[i]] += 1
for i in range(1,n+1):
    if la[i] > n//2 and lb[i] > n//2:
        print("No")
        quit()
print("Yes")
b = b[::-1]
s = 0
for i in range(n):
    if s == 0 and a[i] == b[i]:
        s = i+1
    if s > 0 and a[i] != b[i]:
        e = i+1
        break
if s == 0:
    print(*b)
    quit()
cl = a[s-1]
k = e-s
j = 0
for i in range(n):
    if s-1 <= i < e-1:
        continue
    if cl != b[i] and cl != a[i]:
        b[s-1+j] = b[i]
        b[i] = cl
        j += 1
    if j == k:
        break
print(*b)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b = b[::-1]
s = 0
e = 0
for i in range(n):
    if s == 0 and a[i] == b[i]:
        s = i+1
    if s > 0 and a[i] != b[i]:
        e = i+1
        break
if s == 0:
    print("Yes")
    print(*b)
    quit()
cl = a[s-1]
k = e-s
j = 0
for i in range(n):
    if s-1 <= i < e-1:
        continue
    if cl != b[i] and cl != a[i]:
        b[s-1+j] = b[i]
        b[i] = cl
        j += 1
    if j == k:
        break
for i in range(n):
    if a[i] == b[i]:
        print("No")
        quit()
print("Yes")
print(*b)
def main():
    from collections import Counter
    import sys
    input = sys.stdin.readline
    n=int(input())
    s=[]
    for _ in []*n:
        s.append(input().rstrip())
    c = Counter(s)
    ans=[]
    max_vote = max(c.values())
    for i,j in c.items():
        if j == max_vote:
            ans.append(i)
    print("\n".join(sorted(ans)))
main()

### FIXED CODE ###

from collections import Counter
n=int(input())
s=[]
for _ in range(n):
    s.append(input())
c = Counter(s)
ans=[]
max_vote = max(c.values())
for i,j in c.items():
    if j == max_vote:
        ans.append(i)
print("\n".join(sorted(ans)))
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics


# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

def treesearch(root, data, ans):
    for i in range(len(data)):
        if data[i][0] == root:
            ans[data[i][1]-1] += ans[root-1]
            treesearch(data[i][1], data, ans)

data1 = getInputListInt()
n = data1[0]
q = data1[1]

data2 = getSomeInputListInt(n-1)

data3 = getSomeInputListInt(q)

ans = np.zeros(n)

for i in range(len(data3)):
    ans[data3[i][0]-1] += data3[i][1]

treesearch(1, data2, ans)

for s in ans:
    print(int(s), end =" ")


### FIXED CODE ###

import sys
input = sys.stdin.readline #for input speed
sys.setrecursionlimit(10**6) #for deep recursion
n, q = map(int, input().split())

tree_index = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int, input().split())
  a -= 1
  b -= 1
  tree_index[a].append(b) # a<bとは限らないため、双方向にする
  tree_index[b].append(a)
ans = [0] * n
for i in range(q):
  p, x = map(int, input().split())
  ans[p-1] += x
def dfs(cur, par):
    for chl in tree_index[cur]:
      if chl == par: #parentとchildが等しい時はスキップ
        continue
      ans[chl] += ans[cur] 
      dfs(chl, cur)
dfs(0, -1)
print(*ans)
N=int(input())
    lis=list(map(int,input().split()))
    lis.sort(reverse=True)
    dis={}
    for x in lis:
        if x in dis.keys():
            dis[x]=dis[x]+1
        else:
            dis[x]=1
    lis=[]
    sum=0
    for key,value in dis.items():
        if value<=0:
            continue
        else:
            x = 1
            while (x<=key):
                x*=2
            another = x-key
            if another in dis.keys() and dis[another]>0:
                if another==key:
                    sum+=value//2
                else:
                    m=min(dis[another],value)
                    dis[another]-=m
                    sum+=m
            dis[key]=0
    print(sum)

### FIXED CODE ###

from collections import Counter
if __name__ == "__main__":
    N=int(input())
    lista=list(map(int,input().split()))
    mii=Counter(lista)
    si=set(lista)
    listb=[i for i in si]
    listb.sort()
    ans=0
    while(len(listb)>0):
        x=listb.pop()
        if mii[x]>0:
            k=1
            while k<=x:
                k*=2
            y=k-x
            if x==y:
                ans+=mii[x]//2
            elif y<x and y in si:
                m=min(mii[x],mii[y])
                ans+=m
                mii[y]-=m
            mii[x]=0
    print(ans)
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
a = [0]*(10**5+1)
for i in range(N):
    a[int(input())]+=1

res = 0
for i in range(1,10**5+1):
    if a[i]%2:
        res+=1

print(res)



### FIXED CODE ###


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
a = []
for i in range(N):
     a.append(int(readline()))

a.sort()

res = 0
cnt = 1
for i in range(1,N):
    if a[i] == a[i-1]:
        cnt+=1
    else:
        if cnt%2:
            res+=1
        else:
            cnt=1

            

if cnt%2:
    print(res+1)
else:
    print(res)
def judge(A, B, C, M):
	result = C
	for i in range(M):
		result += A[i] * B[i]

	return result > 0

def main():
	N, M, C = map(int, input().split())
	B = map(int, input().split())
	count = 0

	for i in range(N):
		A = map(int, input().split())

		if judge(A, B, C, M):
			count += 1

	print(count)



if __name__ == '__main__':
	main()

### FIXED CODE ###

def judge(A, B, C, M):
	result = C
	for i in range(M):
		result += A[i] * B[i]

	return result > 0

def main():
	N, M, C = map(int, input().split())
	B = [int(x) for x in input().split()]
	count = 0

	for i in range(N):
		A = [int(x) for x in input().split()]

		if judge(A, B, C, M):
			count += 1

	print(count)



if __name__ == '__main__':
	main()
import sys
import math
from bisect import bisect_left
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def bs(a,n,x): 
    i = bisect_left(a, x) 
    if i<n and a[i] == x:
    	return i
    elif i:
    	return (i-1) 
    else: 
        return -1
n,m,k = MI()
a = LI()
b = LI()
for i in range(1,n):
	a[i]+=a[i-1]
for i in range(1,m):
	b[i]+=b[i-1]
ans = max(bs(a,n,k),bs(b,m,k))+1
for i in range(n):
	if k<a[i]:
		break
	else:
		temp = i+1+bs(b,m,k-a[i])+1
		ans = max(ans,temp)
for j in range(m):
	if k<b[i]:
		break
	else:
		temp = i+1+bs(a,n,k-b[i])+1
		ans = max(ans,temp)
print(ans)



### FIXED CODE ###

import sys
import math
from bisect import bisect_left
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
def bs(a,n,x): 
    i = bisect_left(a, x) 
    if i<n and a[i] == x:
    	return i
    elif i:
    	return (i-1) 
    else: 
        return -1
n,m,k = MI()
a = LI()
b = LI()
for i in range(1,n):
	a[i]+=a[i-1]
for i in range(1,m):
	b[i]+=b[i-1]
ans = max(bs(a,n,k),bs(b,m,k))+1
for i in range(n):
	if k<a[i]:
		break
	else:
		temp = i+1+bs(b,m,k-a[i])+1
		ans = max(ans,temp)
for i in range(m):
	if k<b[i]:
		break
	else:
		temp = i+1+bs(a,n,k-b[i])+1
		ans = max(ans,temp)
print(ans)
Sd=input()
T=input()

flag=False
i=len(Sd)-len(T)
j=0
ans=[]
while(1):
    #print('searching',i,j,Sd[i],T[j])
    if Sd[i]==T[j] or Sd[i]=='?':
        #print('find',i,j,Sd[i],T[j])
        if j==len(T)-1:
            ans.append((Sd[:i-j]+T+Sd[i-j+len(T):]).replace('?','a'))
            #print('complete')
            i-=j+1
            j=0
            flag=True
            continue
        j+=1
        i+=1
    else:
        i-=j+1
        j=0
        hatena=0
        if i<0:
            #print('not find')
            break

ans.sort()
if flag:
    print(ans[0])
else:
    print('UNRESTORABLE')



### FIXED CODE ###

Sd=input()
T=input()


i=len(Sd)-len(T)
j=0
ans=[]
flag=False
while(1):
    if i<0:
        #print('not find')
        break
    #print('searching',i,j,Sd[i],T[j])
    if Sd[i]==T[j] or Sd[i]=='?':
        #print('find',i,j,Sd[i],T[j])
        if j==len(T)-1:
            ans.append((Sd[:i-j]+T+Sd[i-j+len(T):]).replace('?','a'))
            i-=j+1
            j=0
            flag=True
            continue
        j+=1
        i+=1
    else:
        i-=j+1
        j=0

if flag:
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')
import sys
input = sys.stdin.readline

def li():
    return [int(x) for x in input().split()]


N, K = li()
P = [0] + li() + [0]*10
C = [0] + li() + [0]*10
max_scores = [-10**12] * (N+10)
for init_i in range(1, N+1):
    i = init_i
    scores = [-10**12] * (K+10)
    scores[0] = 0
    for l in range(1, K+1):
        i = P[i]
        scores[l] = scores[l-1] + C[i]
    scores[0] = -10**12
    max_scores[i] = max(scores)
print(max(max_scores))

### FIXED CODE ###

def li():
    return [int(x) for x in input().split()]

N, K = li()
P = [0] + li()
C = [0] + li()

def get_cycle(start_i):
    cycle = []
    i = start_i
    while True:
        i = P[i]
        if i == start_i:
            break
        cycle.append(i)
    cycle.append(start_i)
    return cycle

def get_cycle_scores(cycle):
    score = 0
    scores = [score]
    for i in cycle:
        score += C[i]
        scores.append(score)
    return scores

max_scores = []
for start_i in range(1,N+1):
    cycle = get_cycle(start_i)
    scores = get_cycle_scores(cycle)
    cycle_len = len(cycle)
    score_per_cycle = scores[cycle_len]
    # 1cycle以下の場合は全て調べればよし
    if K <= len(cycle):
        max_score = max(scores[move] for move in range(1, K+1))
        max_scores.append(max_score)
        continue
    # 1サイクルごとのスコアがマイナスならサイクルを回らないのがハイスコア
    if score_per_cycle <= 0:
        max_score = max(scores[move] for move in range(1, cycle_len+1))
        max_scores.append(max_score)
        continue
    # 1サイクルごとのスコアがプラスなら限界までサイクルを回るのがハイスコア
    # ラスト1cycleのスコアを調べる
    scores_last_cycle = []
    for move in range(K-cycle_len+1, K+1):
        # 何周したか
        loop_cnt = move // cycle_len
        # あまり
        rest_move = move % cycle_len
        # スコア = 1周ごとのスコア * 何周したか + あまり
        score = loop_cnt * score_per_cycle + scores[rest_move]
        scores_last_cycle.append(score)

    max_scores.append(max(scores_last_cycle))

print(max(max_scores))
def main():
    nvertices, nedges = map(int, input().split())
    Adj = [[] for i in range(nvertices)]
    Adjrev = [[] for i in range(nvertices)]
    for i in range(nedges):
        s, t = map(int, input().split())
        Adj[s].append(t)
        Adjrev[t].append(s)

    ordering = []
    visited = [False] * nvertices
    for u in range(nvertices):
        if not visited[u]:
            dfs1(u, Adj, visited, ordering)

    ordering.reverse()
    component_ids = [-1] * nvertices
    id = 0
    visited = [False] * nvertices
    for u in ordering:
        if visited[u]:
            continue
        dfs2(u, Adjrev, id, visited, component_ids)
        id += 1

    Q = int(input())
    for i in range(Q):
        s, t = map(int, input().split())
        if component_ids[s] == component_ids[t]:
            print(1)
        else:
            print(0)


def dfs1(u, Adj, visited, ordering):
    visited[u] = True
    for v in Adj[u]:
        if visited[v]:
            continue
        dfs1(v, Adj, visited, ordering)
    ordering.append(u)

def dfs2(u, Adj, id, visited, component_ids):
    visited[u] = True
    component_ids[u] = id
    for v in range(Adj[u]):
        if not visited[v]:
            dfs2(v, Adj, id, visited)


main()

### FIXED CODE ###

import sys

def main():
    sys.setrecursionlimit(int(1e5))
    nvertices, nedges = map(int, input().split())
    Adj = [[] for i in range(nvertices)]
    AdjRev = [[] for i in range(nvertices)]
    for i in range(nedges):
        u, v = map(int, input().split())
        Adj[u].append(v)
        AdjRev[v].append(u)

    lst = []
    visited = [False] * nvertices
    for u in range(nvertices):
        if not visited[u]:
            dfs_first(u, Adj, visited, lst)

    lst.reverse()
    ids = [-1] * nvertices
    visited = [False] * nvertices
    id = 0
    for u in lst:
        if not visited[u]:
            dfs_second(u, AdjRev, visited, id, ids)
            id += 1

    Q = int(input())
    for i in range(Q):
        u, v = map(int, input().split())
        print(1 if ids[u] == ids[v] else 0)


def dfs_first(u, Adj, visited, lst):
    visited[u] = True
    for v in Adj[u]:
        if not visited[v]:
            dfs_first(v, Adj, visited, lst)
    lst.append(u)


def dfs_second(u, Adj, visited, id, ids):
    ids[u] = id
    visited[u] = True
    for v in Adj[u]:
        if not visited[v]:
            dfs_second(v, Adj, visited, id, ids)

main()
(m,n)=map(int, raw_input().split())
    if n==0 and m==0 : break
    else: print ((('#'*n)'\n')*m)

### FIXED CODE ###

while True:
    (m,n)=map(int, raw_input().split())
    if n==0 and m==0: break
    else: print (('#'*n+'\n')*m)
N,L = map(int,input().split())
taste = tmp = []
for i in range(1,N):
  tmp.append(abs(L + i -1))
  taste.append((L + i -1))
num = tmp.index(min(tmp)) 
taste.index(num) = 0
print(sum(taste))

### FIXED CODE ###

N,L = map(int,input().split())
taste = []
tmp = []
for i in range(1,N+1):
	tmp.append(abs(L + i -1))
	taste.append((L + i -1))
num = tmp.index(min(tmp)) 
taste[num] = 0
print(sum(taste))
#!/usr/bin/env python

def search(i):
    global edge, child, visit
    work= {i}
    visit[i]= True
    #
    for e in edge[i]:
        if visit[e]: continue
        work|= search(e)
    #
    child[i]= work
    return work

import sys

n,q = [ int(x) for x in sys.stdin.readline().strip().split() ]
n1= n-1
#
edge= [ [] for _ in range(n) ]
for i in range(n1):
    a,b = [ int(x)-1 for x in sys.stdin.readline().strip().split() ]
    edge[a].append( b )
    edge[b].append( a )
#

visit= [ False for _ in range(n) ]
child= [ set() for _ in range(n) ]
search(0)
#
query= dict()
for i in range(q):
    p,x= [ int(x) for x in sys.stdin.readline().strip().split() ]
    query[p-1]= query.get(p-1,0) + x
#
score= [ 0 for _ in range(n) ]
for p,x in query.items():
    for v in child[p]: score[v]+= x
#
for s in score: print( s,end= " " )


### FIXED CODE ###

import sys
from operator import itemgetter

n,q = [ int(x) for x in sys.stdin.readline().strip().split() ]
edge= [ [] for _ in range(n-1) ]
for i in range(n-1):
    edge[i] = [ int(x)-1 for x in sys.stdin.readline().strip().split() ]
edge.sort( key=itemgetter(0) )
c= [ 0 for _ in range(n) ]
for i in range(q):
    p,x= [ int(x) for x in sys.stdin.readline().strip().split() ]
    c[p-1]+= x
#
for a,b in edge: c[b]+= c[a]

print( *c )
import sys
a,b=input().split()
if (a * b ) % 2 == 0:
  print "Even"
else:
  print "Odd"


### FIXED CODE ###

import sys
a,b=input().split()
a = int(a)
b = int(b)
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
N = int(input())
ans = 0

for i in range(N):
  A = int(input())
  ans += 1//A
  
ans = 1//ans

print(ans)
  

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N):
  ans += 1/A[i]
  
ans = 1/ans
print(ans)