CodeEff/ECCO huggingface dataset:
# Original solution
from collections import deque

n, k = list(map(int, input().split()))
h = deque(list(input().split()))
ans = 0

while len(h) > 0:
    if int(h.pop()) >= k:
        ans += 1
        
print(ans)

# Optimized solution
def main():
    N, K = list(map(int, input().split()))
    h = list(int(x) for x in input().split())
    ans = 0

    for i in h:
        if i >= K:
            ans += 1
    
    print(ans)

if __name__ == '__main__':
    main()
# Original solution
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))
print((sum(h[i] >= k for i in range(n))))


# Optimized solution
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = sum(h[i] >= k for i in range(n))
print(ans)
# Original solution
c=0
a = list(map(int,input().split()))
b=list(map(int,input().split()))
for n in range(a[0]):
    if b[n]>=a[1]:
        c+=1

print(c)

# Optimized solution
n,k=list(map(int,input().split()))
h=[int(i) for i in input().split()]
h=[i for i in h if i>=k]
print((len(h)))
# Original solution
def resolve():
    n, k = list(map(int, input().split()))
    h = list(map(int, input().split()))
    ok = [1 if hi >= k else 0 for hi in h]
    print((sum(ok)))


if __name__ == "__main__":
    resolve()


# Optimized solution
def resolve():
    n, k = list(map(int, input().split()))
    h = list(map(int, input().split()))
    oks = [1 for hi in h if hi >= k]
    print((len(oks)))


if __name__ == "__main__":
    resolve()
# Original solution
N,K=list(map(int,input().split()))
h=input().split()
S=0

for i in range(N):
    if int(h[i]) >= K:
        S+=1

print(S)


# Optimized solution
n,k=list(map(int,input().split()))
h=input().split()
S=0
for i in range(n):
  if int(h[i])>=k:
    S+=1
print(S)
# Original solution
n, k = list(map(int, input().split()))
ans = 0
for i in map(int, input().split()): ans+=(i>=k)
print(ans)

# Optimized solution
n,k=list(map(int,input().split()));print((sum([h>=k for h in map(int,input().split())])))
# Original solution
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = 0

for i in h:
  if i >= K:
    ans = ans + 1

print(ans)

# Optimized solution
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
ans = 0
for i in A:
  if i>=K:
    ans = ans + 1
print(ans)
# Original solution
import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


sys.setrecursionlimit(1000000)
mod = 1000000007


# A
def A():
    return


# B
def B():
    n, k = LI()
    h = LI()
    ans = 0
    for i in h:
        if i >= k:
            ans += 1
    print(ans)
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Solve
if __name__ == "__main__":
    B()


# Optimized solution
import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


sys.setrecursionlimit(1000000)
mod = 1000000007


# A
def A():
    return


# B
def B():
    n, k = LI()
    h = LI()
    ans = 0
    for i in h:
        if i >= k:
            ans += 1
    print(ans)
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


def resolve():
    B()
    return


# Solve
if __name__ == "__main__":
    B()
# Original solution
n,k=list(map(int,input().split()))
l=list(map(int,input().split()))
l.sort(reverse=True)
count1=0
for i in l:
  if(i<k):
    break
  count1=count1+1
print(count1)
   

# Optimized solution
n,k=list(map(int,input().split()))
l=list(map(int,input().split()))
count1=0
for i in l:
  if(i>=k):
    count1+=1
print(count1)
# Original solution
a,b=list(map(int,input().split()))
i=list(map(int,input().split()))
j=[x for x in i if x>=b]
print((len(j)))

# Optimized solution
a,b=list(map(int,input().split()))
list_a=list(map(int,input().split()))
list_b=[x for x in list_a if x>=b]
print((len(list_b)))
# Original solution
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,k=list(map(int,input().split()))
    H=list(map(int,input().split()))
    ans=0
    for h in H:
        ans+=(h>=k)
    print(ans)
resolve()

# Optimized solution
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n,k=list(map(int,input().split()))
    print((sum(h>=k for h in map(int,input().split()))))
resolve()
# Original solution
[n, k] = [int(i) for i in input().split()] 

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

def able_ride_jet(const, heights):
    """ ジェットコースターに乗れる人の身長のリストを返す関数
    """
    return list([x for x in heights if x >= const])

print((len(able_ride_jet(k, h))))

# Optimized solution
# -*- coding: utf-8 -*-

def main():
    #入力
    [n, k] = [int(i) for i in input().split()] 
    h = [int(i) for i in input().split()] 

    print((len(able_ride_jet(k, h))))


def able_ride_jet(const, heights):
    """ ジェットコースターに乗れる人の身長のリストを返す関数
    """
    return list([x for x in heights if x >= const])


if __name__ == '__main__':
    main()
# Original solution
n,k = list(map(int,input().split()))
h_list = list(int(i) for i in input().split())
cnt = 0
for i in h_list:
    if i >= k:
        cnt += 1
print(cnt)

# Optimized solution
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, k = list(map(int, input().split()))
    H = list(map(int, input().split()))

    res = 0
    for i in range(n):
        if H[i] >= k:
            res += 1
    print(res)


if __name__ == '__main__':
    resolve()
# Original solution
n , k = list(map(int, input().split()))
h = list(map(int,input().split()))
count = 0

for i in range(n):
    if k <= h[i]:
        count += 1
print(count)

# Optimized solution
#別回答
n , k = list(map(int, input().split()))
h = list(map(int,input().split()))
count = 0

for i in h:
    #print(i)
    if i >= k:
        count += 1
print(count)
# Original solution
n,k=list(map(int,input().split()))
l=0
ll=list(map(int,input().split()))
for i in range(n):
    if ll[i]>=k:
        l+=1
print(l)

# Optimized solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count += 1
print(count)
# Original solution
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

ans = len(list([x for x in h if x>=K]))
print(ans)


# Optimized solution
N, K = list(map(int, input().split()))
print((len(list([x for x in input().split() if int(x)>=K]))))
# Original solution
a,b=list(map(int,input().split()))
height=list(map(int,input().split()))
count=0
for i in range (a):
  	 if int(height[i])>=b:
  	 	count+=1
print(count)

# Optimized solution
a,b=list(map(int,input().split()))
height=list(map(int,input().split()))
count=0
for i in range (a):
  	 if int(height[i])>=b:
  	 	count+=1
print((str(count)))
# Original solution
n,k=list(map(int,input().split()))
L=list(map(int,input().split()))

L.sort()
for i in range(n):
      if L[i]>=k:
            print((n-i))
            exit()
print((0))

# Optimized solution
n,k=list(map(int,input().split()))
L=list(map(int,input().split()))
print((sum(x>=k for x in L)))
# Original solution
N,K=list(map(int,input().split()))
H=list(map(int,input().split()))
print((sum(h>=K for h in H)))

# Optimized solution
N,K=list(map(int,input().split()))
H=list(map(int,input().split()))
print((sum(1 for h in H if h>=K)))
# Original solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count += 1
print(count)

# Optimized solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count = count+1
print(count)
# Original solution
N, K = list(map(int, input().split(" ")))
h = sorted(list(map(int, input().split(" "))))
print((sum([0 if i<K else 1 for i in h])))

# Optimized solution
N, K = list(map(int, input().split(" ")))
print((sum([0 if int(x)<K else 1 for x in input().split(" ")])))
# Original solution
n, k = list(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
ans = 0
for i in h:
    if i >= k:
        ans += 1
print(ans)


# Optimized solution
n, k = list(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
print((sum(i >= k for i in h)))
# Original solution
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))
  
h_=[i for i in h if i >= k]

print((len(h_)))

# Optimized solution
n, k = list(map(int,input().split()))
H = list(map(int,input().split()))
ans = 0
for h in H:
    if h >= k:
        ans += 1
print(ans)
# Original solution
N, K = list(map(int,input().split( )))
H = [int(i) for i in input().split( )]

H = sorted(H)
def binary_search(arr, s, e, x):
    end=e
    start=s
    if end >= start:
        mid = int(s + (end-start)/2)
        if x > arr[mid]:
            binary_search(arr, mid+1, end, x)
        elif x < arr[mid]:
            binary_search(arr, start, mid-1, x)
        else:
            for i in range(mid-start):
                if arr[mid-i-1] < x:
                    start = mid - i
                    break
            print((len(arr)-start))
    else:
        print((len(arr)-start))
binary_search(H,0,N-1,K)

# Optimized solution
N, K = list(map(int,input().split( )))
H = [int(i) for i in input().split( )]

H = sorted(H)
def binary_search(arr, x):
    start = 0
    end = len(arr)-1
    while(end >= start):
        mid = int(start + (end-start)/2)
        if x > arr[mid]:
            start = mid+1
        elif x < arr[mid]:
            end = mid -1
        else:
            for i in range(mid-start):
                if arr[mid-i-1] < x:
                    start = mid - i
                    break
            break
    return start
print((N - binary_search(H, K)))
# Original solution
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))
h = sorted(h)

line = 0
bool1 = False
for i in range(N):
  if h[i] >= K:
    line = i
    bool1 = True
    break

if bool1:
  print((N-i))
else:
  print((0))

# Optimized solution
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))

ans = 0
for i in h:
  if i >= K:
    ans += 1
print(ans)
# Original solution
import bisect
N,K =list(map(int,input().split()))
H =sorted(list(map(int,input().split())))
i = bisect.bisect(H,K-1)
print((N-i))

# Optimized solution
N,K = list(map(int,input().split()))
H  = list(map(int,input().split()))
counter = 0
for h in H:
  if h >= K:
    counter += 1
    
print(counter)
# Original solution
N, K = list(map(int, input().split()))
print((len(list([x for x in list(map(int, input().split())) if x >= K]))))


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

ans = 0

for h in H:
    if h >= K: ans += 1

print(ans)
# Original solution
N, K = list(map(int, input().split()))
lst = list(map(int, input().split()))
i = 0
for h_i in lst:
    if h_i < K:
        continue
    else:
        i += 1
print(i)

# Optimized solution
N, K = list(map(int, input().split()))
lst = list(map(int, input().split()))
i = 0
for h_i in lst:
    if h_i < K:
        continue
    i += 1
print(i)
# Original solution
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    h = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        cnt += 1 if h[i] >= k else 0
    print(cnt)


if __name__ == '__main__':
    slove()


# Optimized solution
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    h = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        if h[i] >= k:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()
# Original solution
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    h = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        if h[i] >= k:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    h = list(map(int, readline().split()))
    cnt = 0
    for i in range(n):
        if h[i] >= k:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    solve()
# Original solution
N,K = list(map(int,input().split()))

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

count =0

for i in range(N):
  if h[i] >= K:
    count += 1
    
    
print(count)
    



# Optimized solution
N,K=list(map(int,input().split()))
h=[int(i) for i in input().split()]

ans =0
for i in range(N):
  if h[i] >=K:
    ans +=1
    
    
print(ans)
# Original solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
print((sum(j >= k for j in h)))

# Optimized solution
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

cnt = 0

for i in h:
    if i >= K:
        cnt += 1

print(cnt)
# Original solution
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

cnt = 0

for i in h:
    if i >= K:
        cnt += 1

print(cnt)

# Optimized solution
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

rst = sum(i >= K for i in h)
print(rst)
# Original solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
count = 0
for h in H:
  if h >= K:
    count += 1

print(count)

# Optimized solution
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
count = 0
for a in h:
   if a >= K:
      count += 1

print(count)
# Original solution
N, K, *h = list(map(int, open(0).read().split()))
print((sum([1 for i in h if K <= i])))


# Optimized solution
N, K, *h = list(map(int, open(0).read().split()))
print((len([1 for i in h if K <= i])))
# Original solution
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
res = 0
for i in a:
    res += int(i >= k)
print(res)

# Optimized solution
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
print((sum(i >= k for i in a)))
# Original solution
n, k = [ int(_) for _ in input().split() ]
h = [ int(_) for _ in input().split() ]

h.sort()

for i in range(len(h)):
  if max(h) < k:
    ans = 0
    break
  elif h[i] >= k:
    ans = len(h[i:])
    break
  
    
print(ans)

# Optimized solution
n, k = [ int(_) for _ in input().split() ]
h = [ int(_) for _ in input().split() ]

h.sort(reverse=True)
flag = True
if h[n-1]>k:
	ans = n
	flag = False
elif h[0] < k:
	ans = 0
	flag = False
#k==max(h)とk==min(h)と合致する場合の分岐がなく、ans=0になっていた
elif h[n-1]==k:
	ans = n
elif h[0]==k:
	ans = h.count(h[0])
if flag == True:
	for i in range(0,n):
		if h[i] < k:
			ans = len(h[0:i])
			break

print(ans)
# Original solution
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))
count = 0
for i in h:
  if i >= k:
    count += 1
    
print(count)

# Optimized solution
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))
print((len([i for i in h if i >= k])))
# Original solution
n,k = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
print((len([i for i in l if i>=k])))

# Optimized solution
n,m = list(map(int,input().split()))
l = [ i for i in input().split() if int(i)>=m]
print((len(l)))
# Original solution
n, k = list(map(int, input().split()))

h = list(map(int, input().split()))[::-1]

ans = 0
for i in range(n) :
    if (h[i] >= k) :
        ans += 1

print(ans)


# Optimized solution
n, k = list(map(int, input().split()))

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

ans = 0
for i in range(n) :
    if (h[i] >= k) :
        ans += 1

print(ans)
# Original solution
def main():
    n, k = [int(x) for x in input().split()]
    h = [int(x) for x in input().split()]
    count = 0
    for i in range(n):
        if h[i] >= k:
            count += 1

    print(count)



if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n,k = list(map(int,input().split()))
    H = list(map(int,input().split()))

    count = 0
    for h in H:
        if h >= k:
            count += 1
    print(count)


if __name__ == '__main__':
    main()
# Original solution
N,K=list(map(int, input().split()))

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

count=0

for h in height:
    if h>=K:
        count+=1

print(count)

# Optimized solution
n,k=list(map(int,input().split()))
h=[int(x) for x in input().split()]

ans=0

for hh in h:
    if hh>=k:
        ans+=1

print(ans)
# Original solution
import sys

def primegen():
  l = [2]
  while True:
    yield max(l)
    n = max(l)
    while True:
      n += 1
      flag = 1
      for i in l:
        if n % i == 0:
          flag = 0
          break
      if flag:
        l.append(n)
        break

for line in sys.stdin:
  n = int(line)
  seq = primegen()
  i1 = 0
  i2 = 0
  while i2 < n:
    i1 = i2
    i2 = seq.__next__()
  if i2 == n:
    i2 = seq.__next__()
  print((str(i1) + " " + str(i2)))

# Optimized solution
import sys

def furui(n):
  l = [1 for i in range(n+1)]
  l[0] = 0
  l[1] = 0
  for i in range(2,n+1):
    if l[i] == 1:
      for j in range(2,n//i+1):
        l[i*j] = 0
  l2 = []
  for i in range (len(l)):
    if l[i] == 1:
      l2.append(i)
  return l2

for line in sys.stdin:
  n = int(line)
  l = furui(n)
  if max(l) == n:
    i1 = l[len(l)-2]
  else:
    i1 = max(l)
  i2 = n
  while True:
    i2 += 1
    flag = 1
    for i in l:
      if i2 % i == 0:
        flag = 0
        break
    if flag:
      break
  print((str(i1) + " " + str(i2)))
# Original solution
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
def LI2(): return [int(eval(input())) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print(('\n'.join(x)))
def printni(x): print(('\n'.join(list(map(str,x)))))
inf = 10**17
mod = 10**9 + 7

n=I()
ans=0
lis=[I() for i in range(n)]
ind =[0 for i in range(n)]
for i in range(n):
    if lis[i]==0:
        ind[i]=-1
    ans+=lis[i]//2
    lis[i]=lis[i]%2
points=[]
for i in range(n):
    if lis[i]==1:
        points.append(i)
for i in range(len(points)-1):
    x=points[i]
    y=points[i+1]
    count=0
    #print(y)
    #print(x)
    for j in range(x,y+1):
        if ind[j]==0:
            count+=1
    if count==y-x+1:
        points[i+1]=-1
        ans+=1
print(ans)





        
        
    
    
        
    
    


# Optimized solution
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
def LI2(): return [int(eval(input())) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print(('\n'.join(x)))
def printni(x): print(('\n'.join(list(map(str,x)))))
inf = 10**17
mod = 10**9 + 7

n=I()
ans=0
lis=[I() for i in range(n)]
ind =[0 for i in range(n)]
for i in range(n):
    if lis[i]==0:
        ind[i]=-1
    ans+=lis[i]//2
    lis[i]=lis[i]%2
points=[]
for i in range(n):
    if lis[i]==1:
        points.append(i)
#print(points)
#for i in range(len(points)-1):
z=0
while z<len(points)-1:
    x=points[z]
    y=points[z+1]
    count=0
    #print(y)
    #print(x)
    for j in range(x,y+1):
        if ind[j]==0:
            count+=1
    if count==y-x+1:
        z+=1
        ans+=1
    z+=1
print(ans)
# Original solution
N = int(eval(input()))
ans = 0
tmp = 0
for _ in range(N):
    a = int(eval(input()))
    if a != 0:
        tmp += a
    else:
        ans += tmp // 2
        tmp = 0
ans += tmp//2

print(ans)

# Optimized solution
N = int(eval(input()))
tmp = 0
ans = 0
for _ in range(N):
    a = int(eval(input()))
    if a != 0:
        tmp += a
    else:
        ans += tmp // 2
        tmp = 0
ans += tmp // 2
print(ans)
# Original solution
from collections import OrderedDict, deque
N = int(eval(input()))
A = OrderedDict({i: int(eval(input())) for i in range(1, N+1)})
ans = 0

for key in range(1, N):
    ans += A[key] // 2
    A[key] %= 2
    if (A[key] == 1) & (A[key+1] > 0):
        ans += 1
        A[key+1] -= 1


print((ans + A[N]//2))

# Optimized solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]

ans = 0
for i in range(N-1):
    ans += A[i] // 2
    if A[i] % 2 and A[i+1]:
        ans += 1
        A[i+1] -= 1

print((ans + A[-1]//2))
# Original solution
import sys
input = sys.stdin.readline


def main():
    N = int(eval(input()))
    carry = 0
    ans = 0
    for i in range(N):
        x = int(eval(input()))
        if carry and x > 0:
            ans += 1  # carry を優先して処理
            d, m = divmod(x - 1, 2)
            ans += d
            carry = m
        else:
            d, m = divmod(x, 2)
            ans += d
            carry = m
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
input = sys.stdin.readline


# 解説AC
def main():
    N = int(eval(input()))
    ans = 0
    x = 0
    for i in range(N):
        a = int(eval(input()))
        if a == 0:
            ans += x//2
            x = 0
        else:
            x += a
    ans += x//2
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
# AGC003B - Simplified mahjong
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    A = list(map(int, [eval(input()) for _ in range(N)])) + [0]
    ans = 0
    for i in range(N):  # make pairs greedily
        ans += A[i] // 2  # pairs with same cards
        if A[i] % 2 and A[i + 1]:  # pairs with a neighbor
            ans += 1
            A[i + 1] -= 1
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# AGC003B - Simplified mahjong
import sys
input = sys.stdin.readline

def main():
    # split in subsequences when 0 appears -> sum up cur // 2
    N = int(eval(input()))
    A = list(map(int, [eval(input()) for _ in range(N)])) + [0]
    ans, cur = 0, 0
    for i in A:
        if i:
            cur += i
        else:
            ans += cur // 2
            cur = 0
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	value = [int(x) for x in range(N)]
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]>=2:
			ans+=1
			card[i]-=2
		elif  i+1 < N:
			if card[i] == 1 and card[i+1]>=1:
				ans+=1
				card[i]-=1
				card[i+1]-=1
			else:
				i+=1
		else:
			i+=1
	print(ans)
main()

# Optimized solution
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]%2==0:
			ans+= card[i]//2
			card[i] = 0
		else:
			ans+=(card[i]-1)//2
			card[i] = 1
			if i+1 < N and card[i+1] >=1:
				ans+=1
				card[i],card[i+1] = 0, card[i+1]-1
		i+=1
	print(ans)
main()