Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
n = int(input())
a = list(map(int, input().split()))
sort = sorted(a)
ans = sort[0]

for i in range(1,n):
    ans = ans * sort[i]

if ans <= 1000000000000000000:
 print(ans)
else:
 print("-1")


### FIXED CODE ###

#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
n = int(input())
a = list(map(int, input().split()))
sort = sorted(a)
ans = sort[0]

for i in range(1,n):
    if ans <= 1000000000000000000:
        ans = ans * sort[i]

if ans <= 1000000000000000000:
 print(ans)
else:
 print("-1")
### BUGGY CODE ###

def burger(level):
    if level==0:
        return "P"
    else:
        return "B"+burger(level-1)+"P"+burger(level-1)+"B"

n,x=[int(x) for x in input().split()]
print(burger(n)[:x].count("P"))

### FIXED CODE ###

# coding: utf-8
# Your code here!
n,x=[int(x) for x in input().split()]
burgurnum=["" for _ in [0]*51]
burgurnumP=["" for _ in [0]*51]
def burgurNumFunc(level):
    if burgurnum[level]=="":
        if level==0:
            burgurnum[level]=1
        else:
            burgurnum[level]=burgurNumFunc(level-1)*2+3
    return burgurnum[level]
def burgurnumPFunc(level):
    if burgurnumP[level]=="":
        if level==0:
            burgurnumP[level]=1
        else:
            burgurnumP[level]=burgurnumPFunc(level-1)*2+1
    return burgurnumP[level]
    
    
def burger(num,level):
    if level==0:
        return 1
    elif num==1:
        return 0
    elif 1<num<=1+burgurNumFunc(level-1):
        return burger(num-1,level-1)
    elif num==burgurNumFunc(level-1)+2:
        return burgurnumPFunc(level-1)+1
    elif burgurNumFunc(level-1)+2<num<=burgurNumFunc(level-1)*2+2-1:
        return burgurnumPFunc(level-1)+1+burger(num - burgurNumFunc(level-1)-2,level-1)
    else:
        return burgurnumPFunc(level-1)*2+1
    

print(burger(x,n))
### BUGGY CODE ###

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

ANS = 1
for a in A:
    ANS = ANS * a

if ANS > 10 ** 18:
    ANS = -1

print(ANS)

### FIXED CODE ###

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

A.sort()
if A[0] == 0:
    ANS = 0
else:
    A.sort(reverse=True)
    ANS = 1
    for a in A:
        ANS = ANS * a
        if ANS > 10 ** 18:
            ANS = -1
            break

print(ANS)
### BUGGY CODE ###

x, y, z, k = map(int, input().split())
c_s = list(map(int, input().split()))
b_s = list(map(int, input().split()))
a_s = list(map(int, input().split()))
a_s.sort(reverse=True)
b_s.sort(reverse=True)
c_s.sort(reverse=True)

d = {}
abcs = [0]
j = -1

for a in a_s:
    for b in b_s:
        for c in c_s:
            abc = a + b + c
            if j >= k and abcs[k-1] >= abc:
                break
            if abcs[0] == 0:
                abcs[0] = abc
            else:
                for i in reversed(range(len(abcs))):
                    if abcs[i] >= abc:
                        abcs.insert(i+1, abc)
                        break
            j += 1
for i in range(k):
    print(abcs[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for ai in a:
  for bi in b:
    ab.append(ai + bi)
ab.sort(reverse = True)

abc = []

for abi in ab[:k]:
  for ci in c:
    abc.append(abi + ci)
abc.sort(reverse = True)

for abci in abc[:k]:
  print(abci)
### BUGGY CODE ###

import fractions
from functools import reduce


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


def lcm_list(n):
    return reduce(lcm, n)


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

mod = 10 ** 9 + 7

L = lcm_list(a)
ans = 0
for i in a:
    ans = (ans + L // i) % mod

print(ans % mod)

### FIXED CODE ###

import fractions
from functools import reduce


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


def lcm_list(n):
    return reduce(lcm, n)


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

mod = 10 ** 9 + 7

L = lcm_list(a)
ans = 0
for i in a:
    ans += L // i

print(ans % mod)
### BUGGY CODE ###

L, R = (int(a) for a in input().split())
mi = 2019
for i in range(L,R):
    for j in range(i+1,R+1):
        mi = min(mi, i*j%2019)
        if mi == 0:
            break
print(mi)

### FIXED CODE ###

l, r = map(int, input().split())
x = []
for i in range(l, r):
    for j in range(i + 1, r + 1):
        mod = i * j % 2019
        x.append(mod)
        if mod == 0:
            print(0)
            exit()
print(min(x))
### BUGGY CODE ###

from math import factorial
N = int(input())
A = list(map(int, input().split()))
n = {}
for i in range(N):
    if A[i] not in n:
        n[A[i]] = 1
    else:
        n[A[i]] += 1
for i in range(N):
    n[A[i]] -= 1
    ans = 0
    for j in n:
        if n[j] > 1:
            ans += factorial(n[j]) // 2 // factorial(n[j]-2)
    n[A[i]] += 1
    print(ans)


### FIXED CODE ###

from math import factorial
N = int(input())
A = list(map(int, input().split()))
n = {}
s = 0
for i in range(N):
    if A[i] not in n:
        n[A[i]] = 1
    else:
        n[A[i]] += 1
for j in n:
    if n[j] > 1:
        s += factorial(n[j]) // 2 // factorial(n[j]-2)
for i in range(N):
    print(s-n[A[i]]+1)
### BUGGY CODE ###

n, k = map(int, raw_input().split(' '))

ans = 0
for i in xrange(n-2):
    i += 1
    for j in xrange(7-2):
        j += 1
        s = 0
        for ii in xrange(3):
            for jj in xrange(3):
                s += 7*(i+ii) + (j+jj) -7

        if ((s % 11) == k):
            ans +=1
print ans


### FIXED CODE ###

n, k = map(int, raw_input().split(' '))

m = n -2
ans = 5*int(m/11)
for i in xrange(m % 11):
    i += 1
    for j in xrange(7-2):
        j += 1
        s = 9*(7*i+j+1)

        if ((s % 11) == k):
            ans +=1
print ans
### BUGGY CODE ###

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

INF = 10**10
#dp = [[INF]*K]*N
dp = [[INF] * (K+1) for i in range(N)]

for i in range(N):
    #j_max = min(K+1, k)
    #print(dp)
    for j in range(1, K+1):
        if i==0:
            dp[i][j] = 0
        elif j>i:
            dp[i][j] = dp[i][j-1]
        else:
            #print(i,j)
            #print(dp[i-j][K]+abs(H[i]-H[i-j]), dp[i][j-1])
            dp[i][j] = min(dp[i-j][K]+abs(H[i]-H[i-j]), dp[i][j-1])
            #print(dp[i][j])

print(dp[N-1][K])

### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
 
INF = 10**9
 
dp = [INF]*N
dp[0] = 0
 
for i in range(N):
    for j in range(1, min(i+1, K+1)):
        dp[i] = min(dp[i], dp[i-j]+abs(H[i]-H[i-j]))
 
print(dp[N-1])
### BUGGY CODE ###

from sys import stdin

gets = stdin.readline


def main():
    n = int(gets())
    for h in range(1, 3501):
        flag = False
        for w in range(1, 3501):
            x = (n * h * w)
            y = (4 * h * w - n * h - n * w)
            if y > 0 and x >= y and x % y == 0:
                print(h, w, x // y)
                flag = True
                break
        if flag:
            break
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin

gets = stdin.readline


def main():
    n = int(gets())
    h, w = 0, 0
    flag = False
    for _ in range(3500):
        h += 1
        w = 0
        for _ in range(3500):
            w += 1
            y = (4 * h * w - n * (h + w))
            if y > 0:
                modulo = n % y * h % y * w % y
                if modulo % y == 0:
                    print(h, w, (n*h*w)//y)
                    flag = True
                    break
        if flag:
            break
    return


if __name__ == "__main__":
    main()
### BUGGY CODE ###

S = input()
NQ = int(input())

reverseFlag = False

for i in range(NQ):
    query = input().split()
    if (int(query[0]) == 1):
        reverseFlag = not reverseFlag
    else:
        if (reverseFlag):
            if (int(query[1]) == 1):
                S = S + query[2]
            else:
                S = query[2] + S
        else:
            if (int(query[1]) == 1):
                S = query[2] + S
            else:
                S = S + query[2]

if (reverseFlag):
    print(S[::-1])
else:
    print(S)



### FIXED CODE ###

S = input()
NQ = int(input())

reverseFlag = False
prefix = ""
suffix = ""

for i in range(NQ):
    query = input().split()
    if (int(query[0]) == 1):
        reverseFlag = not reverseFlag
    else:
        if (reverseFlag):
            if (int(query[1]) == 1):
                suffix = suffix + query[2]
            else:
                prefix = query[2] + prefix
        else:
            if (int(query[1]) == 1):
                prefix = query[2] + prefix
            else:
                suffix = suffix + query[2]

if (reverseFlag):
    print(suffix[::-1] + S[::-1] + prefix[::-1])
else:
    print(prefix + S + suffix)
### BUGGY CODE ###

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

ans = 0
for i in range(N-K+1):
  ans = max(ans, sum(p[i:i+K]))
print ((ans+K)/2)

### FIXED CODE ###

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

tmp = sum(p[0:K])
ans = tmp
for i in range(N-K):
  tmp = tmp + p[i+K]-p[i]
  ans = max(ans, tmp)
print ((ans+K)/2)
### BUGGY CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
INF = 10**4+1
dp = [INF]*n
dp[0]=0
for i in range(1,n):
  hi=h[i]
  dp[i] = min([dp[j] + abs(h[j]-hi) for j in range(max(0, i-k),i)])
print(dp[n-1])

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
INF = 10**4+1
dp = [INF]*n
dp[0]=0
for i in range(1,n):
  dp[i] = min([dp[j] + abs(h[j]-h[i]) for j in range(max(0, i-k),i)])
print(dp[n-1])
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
cnt = 0
m = 1
for i in range(n):
    for j in range(m,n+1):
        if sum(a[i:j]) == 0:
            cnt += 1
    m += 1
print(cnt)

### FIXED CODE ###

import math
from collections import Counter
from itertools import accumulate

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

def C(n,r):
    return P(n,r)//math.factorial(r)

n = int(input())
a = list(map(int,input().split()))
ac = [0] + list(accumulate(a))
c = Counter(ac)

cnt = 0
for v in c.values():
    if v >= 2:
        cnt += C(v,2)
print(cnt)
### BUGGY CODE ###

input_line1 = input()

N = int(input_line1)
count = 0

for i in range (2,N):
    if N % i == 0:
        count += 1
        N = N / i

print(count)

### FIXED CODE ###

N = int(input())
pf = {}
answer = 0

for i in range(2,int(N**0.5)+1):
    while N % i ==0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
    
    if N < i:
        break
if N > 1:
    answer += 1
    
for j, k in pf.items():
    sq = 1
    for l in range(k):
        answer += 1
        k -= sq
        sq += 1
        if k == 0:
            break
        elif k < 0:
            answer -= 1
            break

print(answer)
### BUGGY CODE ###

import sys
import heapq


input = sys.stdin.readline
n = int(input())

result = 0
for i in range(1,n):
    result += i
    
print(result)

### FIXED CODE ###

import sys
import heapq


input = sys.stdin.readline
n = int(input())
result = n*(n-1)//2
print(result)
### BUGGY CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
c=[n for i in range(n)]
for i in range(k):
    b=[0 for i in range(n)]
    for j in range(n):
        for k in range(max(j-a[j],0),min(j+a[j]+1,n)):
            b[k]+=1
    #print(b)
    a=b
    if b==c:
        break
print(*a)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
c=[n for i in range(n)]
for j in range(k):
    d=[0 for i in range(n+1)]
    for i in range(n):
        d[max(i-a[i],0)]+=1
        d[min(i+a[i]+1,n)]-=1
    e=[d[0]]
    for i in range(n-1):#ちょっと特殊な累積和 普通のものの[1:-1]
        e.append(e[i]+d[i+1])
    #print(d,e,sep='\n')
    #print(e)
    a=e
    if e==c:
        break
print(*a)
### BUGGY CODE ###

n,k=map(int, input().split())
h=list(map(int, input().split()))
v=[]
dp=[0]*(n)
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    for j in range(1,k+1):
        if i-j<0:
            break
        v.append(abs(h[i]-h[i-j])+dp[i-j])
    dp[i]=min(v)
    v=[]
        
        
print(dp[n-1])

### FIXED CODE ###

n,k=map(int, input().split())
h=list(map(int, input().split()))
v=[]
dp=[0]*(n)
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    for j in range(1,k+1):
        if i-j<0:
            break
        v.append(abs(h[i]-h[i-j])+dp[i-j])
    dp[i]=min(v)
    v=[]
        
        
print(dp[n-1])
### BUGGY CODE ###

from scipy.misc import comb

N = int(input())
num_list = list(map(int, input().split()))
num_set = set(num_list)

# 全数あるときの組み合わせ
ans_dict_1 = {}
# 1個抜いたときの組み合わせ
ans_dict_2 = {}

for i in num_set:
  num = num_list.count(i)
  ans_dict_1[i] = comb(num,2,exact=True)
  ans_dict_2[i] = comb(num-1,2,exact=True)

total = sum(ans_dict_1.values())

for i in num_list:
  print(total - ans_dict_1[i] + ans_dict_2[i])


### FIXED CODE ###

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

def main():
     n = int(input())
     a = list(map(int, input().split()))
     num_a = dict()
     com_a = dict()

     for i in a:
          if not i in num_a.keys():
               num_a[i] = 1
          else:
               num_a[i] += 1

     for i in num_a.keys():
          value = num_a[i]
          com_a[i] = com(value)

     # print(num_a)
     # print(com_a)

     pre_ans = sum(com_a.values())
     # print('pre_ans:{}'.format(pre_ans))

     for i in range(n):
          k = a[i]
          ans = pre_ans - com_a[k] + com(num_a[k] - 1)
          print(ans)

def com(n):
     return (n * (n - 1)) // 2

if __name__ == "__main__":
    main()
### BUGGY CODE ###

import copy

n=int(input())
lst=[int(input()) for i in range(n)]

ans = []

for i in range(n):
    tmp = copy.deepcopy(lst)
    tmp.pop(i)
    ans.append(max(tmp))
    print(max(tmp))

### FIXED CODE ###

import copy

n=int(input())
lst=[int(input()) for i in range(n)]

ans = [max(lst)] * n

if lst.count(max(lst)) == 1:
    tmp = copy.deepcopy(lst)
    tmp.pop(lst.index(max(lst)))
    ans[lst.index(max(lst))] = max(tmp)

for l in ans:
    print(l)
### BUGGY CODE ###

x = int(input())

for i in range(10000):
    for j in range(-10000, i - 1):
        if x == i ** 5 - j ** 5:
            print(i, j)
            exit()

### FIXED CODE ###

x = int(input())

for a in range(1,1001):
    sub = a ** 5
    ss = sub - x
    for b in range(-1000, 1000):
        if b ** 5 == ss:
            print(a, b)
            exit()
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
l = []
for i in range(n):
    l.append([a[i],i])
l.sort()
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        if l[i][0]+l[j][0] >= n:
            break
        if l[i][0]+l[j][0] == abs(l[i][1]-l[j][1]):
            ans+=1
print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
l1 = []
l2 = []
for i in range(n):
    l1.append(a[i]+i)
    l2.append(-a[i]+i)
j = {}
ans = 0
for i in l1:
    if i in j:
        j[i]+= 1
    else:
        j[i] = 1
for i in l2:
    if i in j:
        ans+=j[i]
print(ans)
### BUGGY CODE ###

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

B = sorted(A)

for i in range(N):
    print(A.index(B[i])+1)

### FIXED CODE ###

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

B = [0]*N

for i in range(N):
    B[A[i]-1] = str(i+1)

print(' '.join(B))
### BUGGY CODE ###

import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

def main():
    n = int(input())
    count = 0
    for i in range(n-1):
        div_lists = make_divisors(i+1)
        count += len(div_lists)
    print(count)
        

if __name__ == "__main__":
    main()

### FIXED CODE ###

import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    ans = 0
    for i in range(1,n):
        ans += (n-1)//i

    print(ans)
        

if __name__ == "__main__":
    main()
### BUGGY CODE ###

import numpy as np
N, K = map(int, input().split())
cnt = np.array([int(x) * 0.5 + 0.5 for x in input().split()])

ans = np.array([sum(cnt[x:y]) for x, y in zip(range(0, N-K+1), range(K, N+1))])
print(ans.max())

### FIXED CODE ###

N, K = map(int, input().split())
cnt = [int(x) * 0.5 + 0.5 for x in input().split()]

add = [0]
for i in cnt:
    add.append(add[-1]+i)

ans = [add[i+K]-add[i] for i in range(N-K+1)]

print(max(ans))
### BUGGY CODE ###

#coding utf-8
N=int(input())

roma = [[0 for i in range(26)] for j in range(N)]

for i in range(N):
  tmp=list(input().strip())
  for j in range(10):
    roma[i][ord(tmp[j])-97] +=1

ans=0    
for i in range(N):
  for j in range(i+1,N):
    if roma[i]==roma[j]:
      ans +=1
    
print(ans)

### FIXED CODE ###

#coding utf-8
N=int(input())

dict={}

ans=0    
for i in range(N):
  tmp = "".join(sorted(input()))
  if tmp not in dict:
    dict[tmp]=0
  else:
    dict[tmp]+=1
    ans+=dict[tmp]
    
print(ans)
### BUGGY CODE ###

import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

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


a=sorted(A,reverse=True)

A_product=1
flag_1e18=False

for i in range(0,N,1):
  A_product=A_product*a[i]
  if A_product>1e18:
    flag_1e18=True
  elif A_product==0:
    flag_1e18=False
  else:
    continue
    
if flag_1e18==True:
  print(-1)
else:
  print(A_product)
  


### FIXED CODE ###

import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

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


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(a_product)
### BUGGY CODE ###


n, m = map(int, input().split())
ab = []
c= []
keys = ["" for _ in range(m)]

for i in range(m):
    ab.append(list(map(int, input().split())))
    kari = list(map(int, input().split()))
    c.append(kari)
    for j in range(n):
        if j+1 in kari:
            keys[i] = keys[i]+"1"
        else:
            keys[i] = keys[i] + "0"

all_patterns = ["0","1"]
options = ["0", "1"]

for _ in range(n-1):
    all_patterns = [j+i for i in (options) for j in all_patterns]

dp_dict = dict()
for pattern in all_patterns:
    dp_dict[pattern] = 1e+10
dp_dict["0"*n] = 0

for j in range(m):
    for key in dp_dict.keys():
        kari1 = dp_dict[key]+ab[j][0]
        kari2 = dp_dict[format(int(key,2)|int(keys[j],2),"0"+str(n)+"b")]
        if kari1 < kari2:
            dp_dict[format(int(key,2)|int(keys[j],2),"0"+str(n)+"b")] = kari1

if dp_dict["1"*n] != 1e+10:
    print(dp_dict["1"*n])
else:
    print(-1)

### FIXED CODE ###


n, m = map(int, input().split())
ab = []
c= []
keys = ["" for _ in range(m)]

for i in range(m):
    ab.append(list(map(int, input().split())))
    kari = list(map(int, input().split()))
    c.append(kari)
    for j in range(n):
        if j+1 in kari:
            keys[i] = keys[i]+"1"
        else:
            keys[i] = keys[i] + "0"

all_patterns = ["0","1"]
options = ["0", "1"]

for _ in range(n-1):
    all_patterns = [j+i for i in (options) for j in all_patterns]

dp = [1e+10 for i in range(2**n)]
dp[0] = 0

#%%
for j in range(m):
    for i in range(len(dp)):
        kari1 = dp[i]+ab[j][0]
        kari2 = dp[i|int(keys[j],2)]
        if kari1 < kari2:
            dp[i|int(keys[j],2)] = kari1

if dp[-1] != 1e+10:
    print(dp[-1])
else:
    print(-1)
### BUGGY CODE ###

import math
import bisect
N,M = map(int,input().split())
Price_List = sorted(list(map(int,input().split())))
for i in range(M):
    New_Price =  Price_List[-1]/2
    Price_List.pop(-1)
    Price_List.insert(bisect.bisect(Price_List,New_Price),New_Price)
print(sum(map(lambda x:math.floor(x),Price_List)))

### FIXED CODE ###

import bisect
 
N,M = map(int,input().split())
Price_List = list(map(int,input().split()))
Price_List.sort()
for i in range(M):
    New_Price = Price_List.pop(-1)//2
    Price_List.insert(bisect.bisect(Price_List,New_Price),New_Price)
print(sum(Price_List))
### BUGGY CODE ###

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

ans = A
for n in range(A+1,B+1):
	ans ^= n
	
print(ans)

### FIXED CODE ###

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

def f0n(y):
	if y % 4 == 0:
		return y
	elif y % 4 == 2:
		return 1^y
	elif y % 4 == 3:
		return 0
	else:
		return 1
				
print(f0n(A-1)^f0n(B))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
s = 0
num = 0
for i in range(N):
    l = i
    s = 0
    while l < N and s + A[l] == s ^ A[l]:
        s += A[l]
        l += 1
    num += l - i
    s -= A[i]

print(num)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
s = 0
num = 0
l = 0
for i in range(N):
    while l < N and s + A[l] == s ^ A[l]:
        s += A[l]
        l += 1
    num += l - i
    s -= A[i]

print(num)
### BUGGY CODE ###

n,m,r=map(int,input().split())
root=list(map(int,input().split()))
abc=[list(map(int,input().split())) for _ in [0]*m]
inf=10**10
dist=[[inf for _ in [0]*n] for _ in [0]*n]
for i in range(n):dist[i][i]=0
for a,b,c in abc:
    dist[a-1][b-1]=c
    dist[b-1][a-1]=c
for k in range(n):
    for i in range(n):
        for j in range(n):dist[i][j]=min(dist[i][j],(dist[i][k]+dist[k][j]))

from itertools import permutations

p=list(permutations(root))

D=10**10
for i in p:
    d=0
    for j in range(len(i)-1):
        d+=dist[i[j]-1][i[j+1]-1]
    D=min(D,d)
print(D)

### FIXED CODE ###

n,m,r=map(int,input().split())
root=list(map(int,input().split()))
abc=[list(map(int,input().split())) for _ in [0]*m]
inf=10**10
dist=[[inf for _ in [0]*n] for _ in [0]*n]
for i in range(n):dist[i][i]=0
for a,b,c in abc:
    dist[a-1][b-1]=c
    dist[b-1][a-1]=c
for k in range(n):
    for i in range(n):
        for j in range(n):dist[i][j]=min(dist[i][j],(dist[i][k]+dist[k][j]))

from itertools import permutations

p=list(permutations(root))

D=10**10
for i in p:
    d=0
    for j in range(len(i)-1):
        d+=dist[i[j]-1][i[j+1]-1]
    D=min(D,d)
print(D)
### BUGGY CODE ###

import math
#math.floor

n, m = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
for i in range(m):
    b = a.pop(a.index(max(a)))
    b *= 1/2
    a.append(b)
result = 0
for i in a:
    result += math.floor(i)
print(result)

### FIXED CODE ###

from heapq import heapify, heappush, heappop
from math import floor
n, m = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
a = [x*(-1) for x in a]
heapify(a)
for _ in range(m):
    x = floor(-heappop(a)/2)*(-1)
    heappush(a, x)

print(-sum(a))