Problem:
 Score : 200 points    Problem Statement We have a board with H horizontal rows and W vertical columns of squares.
There is a bishop at the top-left square on this board.
How many squares can this bishop reach by zero or more movements?  Here the bishop can only move diagonally.
More formally, the bishop can move from the square at the r_1 -th row (from the top) and the c_1 -th column (from the left) to the square at the r_2 -th row and the c_2 -th column if and only if exactly one of the following holds:   r_1 + c_1 = r_2 + c_2  r_1 - c_1 = r_2 - c_2   For example, in the following figure, the bishop can move to any of the red squares in one move:       Constraints  1 \leq H, W \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  H \ W       Output Print the number of squares the bishop can reach.        Sample Input 1 4 5      Sample Output 1 10  The bishop can reach the cyan squares in the following figure:        Sample Input 2 7 3      Sample Output 2 11  The bishop can reach the cyan squares in the following figure:        Sample Input 3 1000000000 1000000000      Sample Output 3 500000000000000000

Solution (Python):
H,W = map(int, input().split())

if ((H==1) or (W==1)):
    ans = 1
elif ((H%2)*(W%2)) ==0:
    ans = ((H/2)*W)
else:
    ans = ((H/2)*W)+1
print(int(ans))

Solution (Python):

H, W = [int(str) for str in input().strip().split()]

print((H * W + 1) // 2 if H != 1 and W != 1 else 1)

Solution (Python):
H, W = map(int,input().split())
if H == 1 or W == 1:
    cnt = 1
else:
    if W % 2 == 0:
        cnt = H*(W//2)
    else:
        cnt = H*(W//2) -(-H//2)
        
print(cnt)

Solution (Python):
h,w=map(int,input().split())
if h==1 or w==1:
    n=1
else:
    n=(h*w)//2 + (h*w)%2
print(n)

Solution (Python):
h,w= map(int, input().split())

if h==1 or w==1:
    print(1)
    exit()

if w%2==0:
    print((w//2)*h)

else:
    if h%2==0:
        print((h//2)*w)
    else:
        print((h//2)*w+(w//2)+1)

Solution (Python):
H, W = map(int, input().split())
if H == 1 or W == 1:
    print("1")
else:
    print((H*W + 1) // 2)

Solution (Python):
from math import ceil
h,w = map(int,input().split())
ans = h * (w // 2)
if w % 2 != 0 :
    ans += ceil(h/2)
if h == 1 or w == 1:
    ans = 1
print(ans)

Solution (Python):
h, w = map(int, input().split())

mas = h*w

if h == 1 or w == 1:
    print(1)
    exit()
if mas % 2 == 0:
    print(mas//2)
else:
    print(mas//2+1)

Solution (Python):
def main():
    w, h = map(int, input().split())

    if w == 1 or h == 1:
        print(1)
        exit()

    h1 = (h + 1) // 2
    h2 = h // 2

    if (w % 2) == 1:
        print(h1 * ((w // 2) + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * (w // 2))


if __name__ == "__main__":
    main()

Solution (Python):
h,w = map(int,input().split())
ans = h * w
if h == 1 or w == 1:
	ans = 2
elif ans % 2 == 1:
	ans += 1
print(ans // 2)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    h, w = map(int, input().split())

    if h == 1 or w ==1:
        ans = 1
    else:
        ans = (h*w+1)/2

    print(int(ans))

if __name__ == '__main__':
    main()

Solution (Python):
import math

def main():
    H,W = list(map(int, input().split(' ')))
    if(H == 1 or W ==1):
        print(1)
    else:
        print(math.ceil((W*H)/2))
main()

Solution (Python):
N = list(map(int, input().split()))
if N[0] == 1 or N[1] == 1:
  print(1)
else:
  print((N[0]*N[1]+1)//2)

Solution (Python):
h, w = map(int, input().split(' '))
a1 = 0
if ((h == 1) or (w == 1)):
    a1 = 1
elif(((h * w) % 2) == 1):
    a1 = ((h * w) // 2) + 1
elif(((h * w) % 2) == 0):
    a1 = (h * w) // 2
print(a1)

Solution (Python):
import sys
input = sys.stdin.readline

H, W = [int(x) for x in input().split()]
ans = 0

if H == 1 and W == 1:
    print(1)
    sys.exit()

if H == 1 or W == 1:
    print(1)
    sys.exit()


b = H // 2


a = H - b

ans += b * (W // 2)
ans += a * (W - (W // 2))

print(ans)

Solution (Python):
h,w = map(int,input().split())
if h == 1 or w == 1:
  print(1)
elif h % 2 == 0:
  print(h//2*w)
else:
  if w % 2 == 0:
    print(h*w//2)
  else:
    print(h*(w-1)//2+h//2+1)

Solution (Python):
H,W=map(int,list(input().split(" ")))
s=0
s+=(W//2+W%2)*(H//2+H%2)
s+=(W-W//2-W%2)*(H-H//2-H%2)
if H==1 or W==1:
    s=1
print(s)

Solution (Python):
h,w=map(int,input().split())
print((h*w+1)//2 if min(h,w)>1 else 1)

Solution (Python):
from math import ceil as c
a,b=map(int,input().split())
if a==1 or b==1:
  print(1)
else:
  print(c(a*b/2))

Solution (Python):
i = list(map(int, input().split()))

H = i[0]
W = i[1]


if(W == 1):
    print(1)
elif(H == 1):
    print(1)

elif(W % 2 == 0):
    yoko = W // 2
    print(yoko*H)

elif(W % 2 != 0):
    yoko = W // 2 + 1
    
    if(H % 2 == 0):
        print(yoko*(H//2)+(yoko-1)*(H//2))
    
    else:
        print(yoko*(H//2+1)+(yoko-1)*(H//2))

Solution (Python):
H, W = map(int, input().split())
from math import ceil
 
if H == 1 or W == 1:
  print(1)
else:
  print(ceil(H*W/2))

Solution (Python):
def mi():return map(int,input().split())
h,w=mi()
if h==1 or w==1:
    print(1);exit()
if h%2==1 and w%2==1:
    ans=h*w//2+1
else:
    ans=h*w//2
print(ans)

Solution (Python):
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    print(int((H*W)//2+(H*W)%2))

Solution (Python):
h, w = map(int, input().split())

ans = (h*w)/2
if h == 1 or w == 1:
    print("1")
elif ans % 1 != 0:
    print((h*w)//2 + 1)
else:
    print(int(ans))

Solution (Python):
import math
def main(h,w):
    if h==1 or w==1:
        return 1
    return math.ceil((w*h)/2)

h,w = map(int, input().split())
print(main(h,w))

Solution (Python):
h, k = [int(i) for i in input().split()]

if h == 1 or k == 1:
    print(1)
elif h%2 == 0:
    print(int(int(h//2)*k))
else:
    if k%2 == 0:
        print(int(h*int(k//2)))
    else:
        print(int(h*int(k//2)+int(h//2)+1))

Solution (Python):
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
elif (h*w)%2==0:
  print(round(h*w/2))
else:
  print(h*w//2+1)

Solution (Python):
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    h,w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        return
    if h*w % 2 == 0:
        print(h*w//2)
    else:
        print(h*w//2 + 1)
    return

if __name__ == '__main__':
    main()

Solution (Python):
i=0
H, W=map(int,input().split())
if H==1 or W==1:
  i=1
elif H%2==1:
  if W%2==1:
    i+=((W+1)//2)*((H+1)//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*((H+1)//2)+(W//2)*(H//2)
elif H%2==0:
  if W%2==1:
    i+=((W+1)//2)*(H//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*(H//2)+(W//2)*(H//2)
print(i)

Solution (Python):
H, W = map(int, input().split())
if H==1 or W == 1:
  print(1)
  quit()

w1 = -(-W//2)
w2 = W-w1
h1 = -(-H//2)
h2 = H - h1
print(w1*h1 + w2*h2)

Solution (Python):
h, w = [int(x) for x in input().split()]

if h == 1 or w == 1:
    ans = 1
elif w % 2 == 0:
    ans = int((w // 2) * h)
else:
    ans = int(((w - 1) // 2) * h + (h + 1) // 2)

print(ans)

Solution (Python):
H,W = map(int,input().split())
if(H==1 or W==1):
    print(1)
else:
    print(((H+1)//2)*((W+1)//2)+(H//2)*(W//2))

Solution (Python):
import math
H,W = input().split()
Hnum = int(H)
Wnum = int(W)
counter = 0
tmp = 0
if Hnum == 1 or Wnum == 1:
    counter =1
elif Hnum%2 == 0:
    counter = int(Hnum/2 * Wnum)
else:
    tmp = math.ceil(Wnum/2)
    Hnum -=1        
    counter = int((Hnum/2 * Wnum) +tmp)
print(counter)

Solution (Python):
import math

H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil(H*W/2.0))

Solution (Python):
h,w = map(int,input().split())
t = (w//2)+(w%2)
print(t*((h+1)//2) + (w-t)*(h//2) if h!=1 and w!=1 else 1)

Solution (Python):

H, W = map(int, input().split())


if W == 1 or H == 1:
    print(1)

elif W%2 == 0:
    print((W//2) * H)
else:
    t = W//2
    if H%2 == 0:
        print((t*2 + 1) * (H//2))
    else:
        print((t*2 + 1) * (H//2) + t+1)

Solution (Python):
from decimal import Decimal
a,b = list(map(int,input().split()))
if a == 1 or b ==1:
    d =1
elif a*b%2==0 and a >1 and b >1:
    d = a*b/2
else:
    d = (a*b+1)/2
print(Decimal(d))

Solution (Python):
H,W = map(int,input().split())
if H == 1 or W == 1: print(1)
elif H * W % 2 == 1: print((H * W  + 1)//2)
else: print(H * W // 2)

Solution (Python):
from decimal import *
H,W=map(int,input().split())
if H==1 or W==1:
	print(1)
	exit()
t = H//2 + H%2
t2 = t + H//2
x = Decimal((W//2*t2)) + Decimal((W%2*t))
print(x)

Solution (Python):
from math import ceil
h,w = map(int,input().split())
ans = h * (w // 2)
if w % 2 != 0 :
    ans += ceil(h/2)
if h == 1 or w == 1:
    ans = 1
print(ans)

Solution (Python):
import math

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

if h == 1 or w == 1:
    ans = 1
elif (h * w) % 2 == 0:
    ans = (h * w) // 2
else:
    ans = (h // 2) * w + math.ceil(w / 2)

print(ans)

Solution (Python):

H,W = map(int, input().split())


h = 0
w = 0
w1 = w2 = 0

if H == 1 or W ==1:
    print(1)


elif W % 2 == 1:
    w = int(W /2) + 1
    if H % 2 == 1:
        h = int(H / 2) + 1
        w1 = h * w
        w2 = (w-1) * (h-1)
        print(w1 + w2)
    else:
        h = int(H / 2)
        w1 = w * h
        w2 = (w-1) * h
        print(w1 + w2)
        
        
else:
    w = int(W / 2)
    print(w * H)

Solution (Python):



input_line = input()
lines = input_line.split()
x=int(lines[0])
y=int(lines[1])
input_num=x*y
if(x==1 or y==1):
  print(1)
else:
  if((x*y)%2==1):
    print(int(input_num/2)+1)
  else:
    print(int(input_num/2))

Solution (Python):
H, W = map(int, input().split())
if H==1 or W == 1:print(1)
else:print(int((H*W+1)//2))

Solution (Python):
a,b = map(int,input().split())
num1 = (a//2)*(b//2)

if a == 1 or b==1:
    print(1)
else:
    
    
    p = b//2
    q = a//2
    num2 = (b - p )*(a - q)
    ans = num1+num2
    print(num1+num2)

Solution (Python):
H,W=list(map(lambda i:int(i),input().split()))
masume=H*W
if (H==1) or (W==1):
    answer =1
elif masume%2 ==0:
    answer = masume//2
else:
    answer = (masume+1)//2
print(answer)

Solution (Python):
h,w=map(int,input().split())
if h==1 or w==1:
  print('1')
else:
  print((h*w+1)//2)

Solution (Python):
import glob



REL_PATH = 'ABC\\159\\B'


TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        tmp = [int(i) for i in self.input_data().split()]
        H = tmp[0]
        W = tmp[1]

        if H ==1 or W ==1:
            print("1")
        else:
            count = int(H * W / 2)

            if H % 2 == 1 and W % 2 == 1:
                count += 1

            print(str(count))


solver = Solver(REL_PATH)
solver.exec_resolve()

Solution (Python):
arr = input().split()
h=int(arr[0])
w=int(arr[1])
 
if w*h%2!=0 and h!=1 and w!=1:
    ans=(w*h+1)//2
elif h==1 or w==1:
    ans=1
else:
    ans=w*h//2
print(ans)

Solution (Python):
H, W = map(int, input().split())
import math
if min(H, W) > 1:
    print(math.ceil(H/2) * math.ceil(W/2) + math.floor(H/2) * math.floor(W/2))
else:
    print(1)

Solution (Python):
from math import ceil
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
	print(ceil(h/2)*ceil(w/2) + int(h/2)*int(w/2))

Solution (Python):
import math
 
h,w = [int(x) for x in input().split()]
if h==1 or w==1:
    print(1)
else:
    ans = math.ceil(h*w/2)
    print(ans)

Solution (Python):
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    if H%2==1 and W%2==1:
        print((H*W)//2+1)
    else:
        print(H*W//2)

Solution (Python):
n, m = input().split()
n, m = int(n), int(m)

if n==1 or m==1:
  ans = 1
elif m%2==1:
  d = (m+1)/2
  if n%2==0:
    ans = (d+d-1)*n/2
  else:
    ans = (d+d-1)*(n-1)/2 + d
else: 
  ans = n * m/2
print(int(ans))

Solution (Python):
h, w = map(int, input().split())
ans = 0
if (h % 2 == 0) or (w % 2 == 0):
    ans = (h * w) // 2
else:
    ans = (h * w) // 2 + 1

if h == 1 or w == 1:
    ans = 1
print(ans)

Solution (Python):
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
else:
  print(int(((h * w) + 1)/2))

Solution (Python):
if __name__ == '__main__':
	H, W = map(int, input().split())

	ans = 0
	
	if H ==1 or W == 1:
		ans = 1
	elif H % 2 == 0 or W % 2 == 0:
		ans = H * W / 2
	else:
		ans = H * (W - 1) / 2 + (H+1) / 2

	print(int(ans))

Solution (Python):
h, w = map(int, input().rstrip().split())

if h == 1 or w == 1:
  print(1)
else:
  print((h * w + 1) // 2)

Solution (Python):
[h,w] = [int(x) for x in input().split()]

if h == 1 or w == 1:
    print(1)

else:
    row1 = w//2 + w%2
    row2 = w//2

    total = (row1 * (h//2+h%2)) + (row2 * (h//2))

    print(total)

Solution (Python):

from decimal import *
s = input().split()
t = [int(p) for p in s]



if(t[0] == 1 or t[1] == 1):
    answer = 1
elif( Decimal(Decimal(t[0]) % 2 )== 1 and Decimal(Decimal(t[1]) % 2) == 1):
    n = Decimal( Decimal(Decimal(t[0]) - 1) // 2  )
    
    m = Decimal( Decimal(Decimal(t[1]) - 1) // 2  )
    answer = Decimal(    Decimal(  Decimal(Decimal(m) + 1)     *    Decimal(Decimal(n) + 1)  )   + Decimal( Decimal(m) * Decimal(n) )       )
else:
    answer = Decimal(   Decimal(Decimal(t[0]) * Decimal(t[1])) // 2  )

print(int(answer))

'''
H = t[0]
W = t[1]
ans = 0
if( W % 2 == 0):
    for i in range(H):
        ans += W / 2
else:
    for i in range(H):
        if(i % 2 == 0):
            ans += W / 2.0 + 0.5
        else:
            ans += W / 2.0 - 0.5
print(int(ans))
'''

Solution (Python):
n, m = (int(x) for x in input().split())

if n == 1 or m == 1:
  ans = 1
else:
  if n % 2 == 0:
    ans = n * m // 2
  else:
    if m % 2 == 0:
      ans = n * m // 2
    else:
      ans = n * m // 2 + 1
print(ans)

Solution (Python):
import math
a,b=map(int, input().split()) 

if a==1 or b==1:
	print(1)
elif a*b%2 == 0:
	print(int(a*b/2))
elif a*b%2 == 1:
	print(int(math.floor(a*b/2+1)))

Solution (Python):
h, w = map(int, input().split())

if h == 1:
    print(1)
elif w == 1:
    print(1)
elif h%2 == 0 or w%2 == 0:
    print(h*w//2)
else:
    ans = (h + 1) * w // 2
    print(ans - int(w/2))

Solution (Python):
h,w = map(int,input().split())

hw = h*w
if(h == 1 or w == 1):
  ans = 1
elif(hw%2==1):
  ans = (int)(hw/2)+1
else:
  ans = (int)(hw/2)
  
print(ans)

Solution (Python):
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
else:
  print(int(((h * w) + 1)/2))

Solution (Python):
def resolve():
    H, W = map(int, input().split())

    if H == 1 or W == 1:
        print(1)
        return

    count = H * W
    ans = count // 2

    if count % 2 != 0:
        ans += 1

    print(ans)

resolve()

Solution (Python):
a, b = map(int,input().split(' '))
ans = a*b//2

if (a*b)%2 == 1:
  ans+=1
if a == 1 or b == 1:
    print(1)
else:
    print(ans)

Solution (Python):
h,w = map(int,input().split())

if h == 1:
    print(1)
elif w == 1:
    print(1)
else:

    if w%2 == 0:
        a = w//2
        b = w//2
    else:
        a = w//2 + 1
        b = w//2

    if h%2 == 0:
        c = h//2
        d = h//2
    else:
        c = h//2 + 1
        d = h//2

    print(a*c + b*d)

Solution (Python):
import math
def resolve():
    H,W = map(int,input().split())

    dd= W*(H//2)

    if H%2==1:
        dd += math.ceil(W/2)
    print(1 if H==1 or W==1 else dd) 
    


if __name__ == "__main__":
    resolve()

Solution (Python):
h,w=map(int,input().split())
if h==1:
    print(1)
    exit()
elif w==1:
    print(1)
    exit()
if h%2==1 and w%2==1:
    ans=int((h*w+1)/2)
elif h%2==0:
    ans=int(h/2*w)
else:
    ans=int(w/2*h)
print(ans)

Solution (Python):
H, W = [int(x) for x in input().split()]

if H == 1 or W == 1:
    print(1)
else:
    print(-(-H * W //2))

Solution (Python):
def Main(H, W):
    if H == 1 or W == 1:
        return 1
    else:    
        if W%2:
            if H%2:
                return W*(H//2)+(W//2+1)
            else:
                return W*(H//2)
        else:
            if H%2:
                return W*(H//2)+W//2
            else:
                return W*(H//2)
                

def main():
    H, W = map(int, input().split())
    print(Main(H, W))

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
from decimal import *
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
    else:
        print(math.ceil(h*w/2))


main()

Solution (Python):
H, W = map(int, input().split())

if H == 1 or W == 1:
  print(1)
elif H % 2 == 0 or W % 2 == 0:
  print(H * W // 2)
else:
  print((H * W - 1) // 2 + 1)

Solution (Python):
def resolve():
    h, w = map(int, input().split())
    dy = h // 2 if h != 1 else 1
    if h == 1 or w == 1:
        count = 1
    elif h % 2 == 1:
        count = w * dy + (w - (w // 2))
    else:
        count = w * dy

    print(count)


if __name__ == '__main__':
    resolve()

Solution (Python):
h,w=map(int,input().split())
result = h*w
if h==1 or w==1:
    print(1)
elif result%2==0:
    print(int(result//2))
else:
    print(int(result//2)+1)

Solution (Python):
h,w = map(int, input().split())
tmp = (w + 1)//2 if h % 2 else 0
if h == 1 or w == 1:
    print(1)
    exit()
print((h//2) * w + tmp)

Solution (Python):
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
elif H==W and (H%2)==1:

    print(int(-(-(H*W)//2)))
elif H==2:

    print(W)
elif W==2:
    print(H)
elif H%2==0 and W%2==0:

    print(int(W*H/2))
elif H%2==1 and W%2==1:
    mas=-(-W//2)
    nextmas=mas-1
    Sset=int(H/2)
    amari=H%2


    num=(mas+nextmas)*Sset

    num+=mas*amari

    print(int(num))


else:
    
    print(int(H*W/2))

Solution (Python):
h,w = map(int,input().split())

if h == 1 or w == 1:
    print(1)

elif h%2 == 0 or w%2 == 0:
    if h%2 == 0:
        result = (h//2) * w
        print(result)
    else:
        result = (w//2) * h
        print(result)
else:
    result = (h//2) * (w//2) + (h - h//2) * (w - w//2)
    print(result)

Solution (Python):




def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        ans = 1
    elif h % 2 == 0:
        ans = (h // 2) * w
    elif w % 2 == 0:
        ans = (w // 2) * h
    else:
        ans = h * (w // 2) + (h // 2) + 1
    print("%d" % ans)


if __name__ == '__main__':
    main()

Solution (Python):
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 or w == 1):
  print(1)

elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Solution (Python):
h,k = map(int,input().split())
if (h == 1) or (k == 1):
  print(1)
else:
  print(int(((h-1)*(k-1) + (h+k))/2)  if h*k % 2 != 0 else int(h*k/2))

Solution (Python):
H ,W = map(int, input().split())

if W == 1 or H == 1:
    print(1)
elif H * W % 2 == 0:
    print(H * W //2)
else:
    print((H * W + 1) // 2)

Solution (Python):
from math import ceil
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  if h%2:
    if w%2:
      print(ceil(h/2)*ceil(w/2)+(h//2)*(w//2))
    else:
      print(h*(w//2))
  else:
    print((h//2)*w)

Solution (Python):
H,W=map(int,input().split())
a=(H+1)//2;b=(W+1)//2
c=H//2;d=W//2
if(H==1 or W==1):
    print(1)
else:
    print(a*b+c*d)

Solution (Python):
from decimal import Decimal
import sys
n = list(map(int, input().split()))

if n[0] == 1 or n[1] == 1:
    print(1)
    sys.exit()

if n[0] % 2 == 0:
    print(Decimal(int((n[0]/2)*n[1])))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(Decimal(int(n[0]*(n[1]/2))))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(Decimal(int(a+b)))
        sys.exit()

Solution (Python):
import math
m,n = map(int,input().strip().split())
if n==1 or m==1:
    print("1")
else:
    print(math.ceil((m*n)/2))

Solution (Python):
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
elif h % 2 == 1 and w % 2 == 1:
    print(int((h * w + 1) / 2))
else:
    print(int(h * w / 2))

Solution (Python):
h, w = [int(s) for s in input().split()]
if h == 1 or w == 1:
    print(1)
    exit()
rh, rw = h%2, w%2
eh, ew = h - rh, w- rw

result = int( eh * ew //2)
if rh == 1:
    result += ew //2
if rw == 1:
    result += eh //2
if rh == rw == 1:
    result += 1

print(result)

Solution (Python):
H,W=map(int,input().split())

if H==1 or W==1:
    print(1)
else:
    

    if H%2==0 and W%2==0:
        print(int(H*(W/2)))
    elif H%2!=0 and W%2==0:
        print(int(W/2*H))
    elif H%2==0 and W%2!=0:
        a=(H//2)*(W//2+1)
        b=(H//2)*(W//2)
        print(int(a+b))
    else:
        a=(H//2+1)*(W//2+1)
        b=H//2*(W//2)
        print(int(a+b))

Solution (Python):
H, W = map(int, input().split())

if H == 1 or W == 1:
  print(1)
else:
  print(H * W // 2 + (H * W) % 2)

Solution (Python):


H, W = map(int, input().split())

if H == 1 or W == 1:
    ans = 1

else:
    if H%2 == 0:
        ans = H//2 * W

    else:
        ans = ((H//2)+1)*W - (W//2)

print(ans)

Solution (Python):
H, W = map(int, input().split())
if H*W%2 == 0 and H!=1 and W!=1:
    print(int(H*W/2))
elif H == 1 or W == 1:
    print(1)    
else:
    if H > W:
        print(int((H-1)*W/2-(-W//2)))
    elif H == W:
        print(int((W-1)*H/2-(-H//2)))
    else:
        print(int((W-1)*H/2-(-H//2)))

Solution (Python):
H,W=map(int,input().split())
if H == 1 or W == 1:
  print(1)
else:
  print((H*W+1)//2)

Solution (Python):
H, W = map(int, input().split())

output = H * W

if output % 2 != 0:
    output += 1
output /= 2

if H == 1 or W == 1:
    output = 1
    
print(int(output))

Solution (Python):
def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
    else:
        print( (h // 2) * w + (h % 2) * ((w // 2) + (w % 2)) )

if __name__ == '__main__':
    main()

Solution (Python):
h ,w = map(int,input().split())
if h == 1 or w == 1:
    print("1")
elif h * w % 2 == 0:
    print(h * w // 2)
else:
    print(h * w // 2 + 1)

Solution (Python):
def main():
    w, h = map(int, input().split())
    f = w%2==0
    g = h%2==0
    a = w*h//2
    if w==1 or h==1:
        print(1)
        exit()
    if not f and not g:
        print(a+1)
    else:
        print(a)

if __name__ == '__main__':
    main()

Solution (Python):
h, w = map(int, input().split())

if h==1 or w==1:
    print(1)
elif h*w%2==0:
    print(int(h*w/2))
else:
    print(int(h*w//2+1))

Solution (Python):

import sys


def solve(H: int, W: int):
    if H == 1 or W == 1:
        print(1)
        return
        
    first = W//2 if W%2 == 0 else (W//2)+1
    second = W//2

    if H%2 == 0:
        print(first*(H//2)+second*(H//2))
    else:
        print(first*(H//2+1)+second*(H//2))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  
    W = int(next(tokens))  
    solve(H, W)

if __name__ == '__main__':
    main()

Solution (Python):
i = input().split()
h = int(i[0])
w = int(i[1])

if h == 1 or w == 1:
  	print(1)
else:
    if h % 2 != 0:
        move_h = int(h / 2)
        if w % 2 == 0:
            print((move_h * w) + int(w /2))
        else:
            print((move_h * w) + int((w /2)+1))
    else:
        move_h = h / 2
        print(int(move_h * w))

Solution (Python):
import math

inp = input()
hw = inp.split(' ')
hi = int(hw[0])
wi = int(hw[1])

gusu_p = math.ceil(wi/2)
kisu_p = math.floor(wi/2)

gusu_num = math.ceil(hi/2)
kisu_num = math.floor(hi/2)

ret = (gusu_p*gusu_num) + (kisu_p * kisu_num)

if hi == 1:
    print('1')
elif	wi == 1:
    print('1')
else:
    print('{}'.format(ret))

Solution (Python):
h, w = map(int, input().split())

if h == 1 or w == 1:
    print(1)
else:
    if h % 2 != 0 and w % 2 != 0:
        print(int((h*w-1)/2 + 1))
    else:
        print(int((h*w)/2))

Solution (Python):
from math import floor, ceil

H, W = map(int,input().split(" "))


if H == 1 or W == 1:
    ans = 1
elif H%2 == 0:
    ans = (H//2)*W
elif W%2 == 0:
    ans = (W//2)*H
else:
    ans = 0
    ans += floor(H/2) * floor(W/2)
    ans += ceil(H/2) * ceil(W/2)


print(int(ans))

Solution (Python):
h, w = map(int, input().split())

if h == 1 or w == 1:
  print(1)
elif h % 2 == 1 and w % 2 == 1:
  print((h * w + 1) // 2)
else:
  print(h * w // 2)

Solution (Python):
import math
H, W = map(int, input().split())

a = H * W
b = 0


if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil(a/2))

Solution (Python):
h, w = map(int, input().split())
if h == 1 or w == 1:
  a = 1
elif h % 2 == 1 and w % 2 == 1:
	a = int((h * w + 1) / 2) 
else:
	a = int(h * w / 2)
print(a)

Solution (Python):
h, w = map(int, input().split())
A = h//2*w + (h%2)*(w - w//2)
if h == 1 or w == 1:
    A = 1
print(A)

Solution (Python):
i = list(map(int, input().split()))
H = i[0]
W = i[1]

if H == 1 or W == 1:
    print(1)
else:
    if H % 2 == 0 or W % 2 == 0:
        print(int(W * H / 2))
    else:
        print(int(W * H // 2) + 1)

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

from math import ceil

h, w = na()

if h == 1 or w == 1:
    print(1)
else:
    print(ceil(h * w / 2))

Solution (Python):
H, W = map(int, input().split())




if H == 0 or W == 0:
    print(int(0))

elif H == 1 or W == 1:
    print(int(1))

elif H % 2 == 0 and W % 2 == 0:
    print(int(H/2 * W))

elif H % 2 == 0:
    print(int(H/2 * W))

elif W % 2 == 0:
    print(int(W/2) * H)

elif H % 2 != 0 and W % 2 != 0:
    key = W // 2
    ans = H * key
    print(int(ans + (H-H//2)))

Solution (Python):
H, W = map(int, input().split())
print( 1 if (H==1 or W==1) else (H//2)*W + (H%2)*((W+1)//2))

Solution (Python):
from sys import stdin
import math

h,w = [int(x) for x in stdin.readline().rstrip().split()]
if (h==1)|(w==1):
    ans = 1
else:
    ans = int(w/2)*h + (w%2)*math.ceil(h/2)
print(ans)

Solution (Python):
from collections import deque, defaultdict, Counter
from math import ceil, floor
import sys
def input():
    return sys.stdin.readline().strip()

H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
    exit()

if H > W:
    H, W = W, H


ans = W * (H // 2)

if H % 2 == 1:
    
    
    ans += ceil(W / 2)  
print(ans)

Solution (Python):
from decimal import Decimal, getcontext
a, b = map(int, input().split())
getcontext().prec = 50
c = Decimal(a) * Decimal(b)
if a == 1 or b == 1:
    print(1)
else:  
    if c % 2 == 1:
        print(int(c/2)+1)
    else:
        print(int(c/2))

Solution (Python):

import math
H,W = list(map(float,input().split()))
if H==1 or W==1:
  print("1")
else:
  ans = H*W/2
  print(math.ceil(ans))

Solution (Python):
h, w = map(int, input().split())

if h == 1 or w == 1:
  a = 1

elif h % 2 == 1 and w % 2 == 1:
	a = int((h * w + 1) / 2) 
else:
	a = int(h * w / 2)
    
print(a)

Solution (Python):
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print(-(-h*w//2))

Solution (Python):
h,w = map(int, input().split())

if w == 1 or h == 1:
    print(1)
    exit()
    
if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2

if h % 2 == 1 and w % 2 == 0:
    print(int((w / 2) * h))
    exit()

if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)

Solution (Python):
h, w = map(int, input().split())

if w == 1:
  print(1)
  exit()
if h == 1:
  print(1)
  exit()

print((h*w-1)//2+1)

Solution (Python):
HW=input().rstrip('\n').split()
H=int(HW[0])
W=int(HW[1])
if H==1 or W==1 :
    print (1)
elif H%2==1 and W%2==1 :
    print (int((H*W+1)/2))
else :
    print(int(H * W / 2))

Solution (Python):
H, W = (int(x) for x in input().split())

if H == 1 or W == 1:
    k = 1
elif H*W % 2 == 1:
    k = int(H / 2) + (int(W / 2)) * H + 1
else:
    k = int(H * W / 2)

print(k)

Solution (Python):
H, W = [int(i) for i in input().split()]

if H==1 or W==1:
    print(1)
    quit()
if H%2==0:
    H //= 2
    print(H*W)
elif W%2==0:
    W //= 2
    print(H*W)
else:
    W -= 1
    c = (W//2)*H
    c += H//2 + 1
    print(c)

Solution (Python):
H, W = map(int, input().split())
if H % 2 == 1 and W % 2 == 1:
  N = (H * W) // 2 + 1
else:
  N = (H * W) // 2

if H == 1 or W == 1:
  N = 1
print(N)

Solution (Python):
H,W=map(int, input().split())
ans=H*(W//2)
if W&1:
    ans+=(H+1)//2
if H==1 or W==1:
    ans=1
print(ans)

Solution (Python):
H, W = map(int, input().split())

ans = 1
if H > 1 and W > 1:
  ans = H * (W // 2)
  if W % 2 == 1:
    ans += (H + 1) // 2

print(ans)

Solution (Python):
from math import ceil
h,w = map(int, input().split())
if (h==1) or (w==1):
  print('1')
else:
    print(ceil(h*w/2))

Solution (Python):
H,W=map(int,input().split())

if (W%2==0 or H%2==0) and W>2 and H>2 :
    print(int(H*W/2))
else :
    if H==1 or W==1 :
        print(1)
    else :
        print(int((H*W//2)+1))

Solution (Python):
H,W =map(int,input().split())
if H==1 or W==1:
  print(1)
elif H%2==0:
  print(W*H//2)
else:
  if W%2==1:
    print(W*(H//2)+W//2+1)
  else:
    print(W*(H//2)+W//2)

Solution (Python):
import math
h,w=map(int,input().split())
if h==1 or w==1:print(1)
elif h%2==0:print(w*(h//2))
else:print(w*(h//2)+math.ceil(w/2))

Solution (Python):
H,W = map(int,input().split())
K = 0
L = 0


if H == 1:
    K = 1
elif W == 1:
    K = 1
elif H == 2:
    K = W
elif W == 2:
    K = H
else:
    if H%2 == 1 and W%2 == 1:
        K = (H//2+1)*(W//2+1)
        L = (H//2)*(W//2)
    
    elif H%2 == 1 and W%2 == 0:
        K = (H//2+1)*(W//2)
        L = (H//2)*(W//2)
    
    elif H%2 == 0 and W%2 == 1:
        K = (H//2)*(W//2+1)
        L = (H//2)*(W//2)
    else:
        K = H*(W//2)
        L = 0
print(K+L)

Solution (Python):
n, w = map(int, input().split())


if n == 1 or w == 1: 
    ans = 1
elif n % 2 == 0 or w % 2 == 0:
    ans = int((n * w) / 2.)

else:
    ans = int((n * w) / 2.) + 1

print(ans)