"""

author : halo2halo

date : 24,Oct,2019

"""



import sys

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 7)



n, a = list(map(int, readline().rstrip().split()))





ans = int((n+a+1)/2)



print(ans)

"""

author : halo2halo

date : 29, Jan, 2020

"""



import sys

import itertools



# import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



A, B = list(map(int, readline().split()))



print(((A+B+1)//2))

"""
author : halo2halo
date : 24,Oct,2019
"""
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**7)
n, a = list(map(int, readline().rstrip().split()))
ans = int((n + a + 1) / 2)
print(ans)

"""
author : halo2halo
date : 29, Jan, 2020
"""
import sys
import itertools

# import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A, B = list(map(int, readline().split()))
print(((A + B + 1) // 2))

-date : 24,Oct,2019 +date : 29, Jan, 2020 +import itertools -readline = sys.stdin.readline -readlines = sys.stdin.readlines -sys.setrecursionlimit(10**7) -n, a = list(map(int, readline().rstrip().split())) -ans = int((n + a + 1) / 2) -print(ans) +# import numpy as np +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +A, B = list(map(int, readline().split())) +print(((A + B + 1) // 2))