peterverebics/CodeNet_Python_118 huggingface dataset:
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    exit()

if H*W % 2 != 0:
    print(H*W//2+1)
else:
    print(H*W//2)
import sys
input = sys.stdin.readline

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

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

allmas = h*w

if allmas % 2 == 1:
    print(int((allmas/2) + 0.5))
else:
    print(int(allmas/2))
h,w = map(int,input().split(" "))
if h == 1 or w == 1:
    print(1)
    exit()
if h % 2 == 0:
    print((h // 2) * w)
else:
    if w % 2 == 0:
        print((h // 2) * w + (w // 2))
    else:
        print((h // 2) * w + (w // 2) + 1)
import math
h,w = map(int,input().split())

#
if h==1 or w==1:
    print(1)
else:
    print((h*w+1)//2)
H,W = map(int, input().split())
if H==1 or W==1:
  print(1)
else:
  print(-(-(H*W)//2))
import sys
h,w=map(int,input().split())
n=h*w
if h==1 or w==1:
  print(1)
  sys.exit()
if n%2==0:
  print(n//2)
else:
  print(n//2+1)
import math

h,w = map(int, input().split())
if (h == 1 or w == 1):
    print(1)
else:
    print(math.ceil(h/2)*math.ceil(w/2)+math.floor(h/2)*math.floor(w/2))
H, W = map(int, input().split())

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

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

print(ans)
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
  exit()
print((H*W+1)//2)
# coding: utf-8
from math import ceil
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(ceil(H * W / 2))
H, W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    ans = H*W
    if ans % 2:
        print(ans//2+1)
    else:
        print(ans//2)
H, W = [int(i) for i in 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)
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
    exit()
if (H*W)%2==0:
    print(int(H*W/2))
else:
    ans=((H//2+1)*(W//2+1))+((H-(H//2+1))*(W//2))
    print(ans)
#6
import sys
H,W = map(int,input().split())
k = H*W

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

if k%2 == 0:
    print(int(k/2))
else:
    print(int(k/2)+1)
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)
def submit():
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
        return
    
    even_c = sum(divmod(w, 2))
    odd_c = w // 2
    even_row = sum(divmod(h, 2)) * even_c
    odd_row = (h // 2) * odd_c

    print(even_row + odd_row)


if __name__ == "__main__":
    submit()
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)
import sys
H, W = list(map(int, input().split()))


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

if W % 2 == 0:
    kisu = W // 2
    gusu = W // 2
else:
    kisu = W // 2 + 1
    gusu = W // 2

if H % 2 == 0:
    ans = (kisu + gusu) * (H // 2)
else:
    ans = (kisu + gusu) * (H // 2) + kisu

print(ans)
H,W = map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    print((H*W+1)//2)
H, W  = map(int, input().split())
if (H==1) or (W == 1):
	print(1)
elif (H%2==0) or (W%2==0):
	print(int(H*W/2))
else:
	print(int((H*W+1)/2))
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    print(int((H*W)//2+(H*W)%2))
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
  exit(0)
if W%2==0:
  w=W//2
  ans=w*H
else:
  w=W//2 + 1
  ans=w*H
  ans-=H//2
print(ans)
import sys

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

all = h*w

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


if all % 2 == 0:
    ans = all//2
else:
    ans = all//2+1

print(ans)
import math
w,h=map(int, input().split())

if w == 1 or h == 1:
    print(1)
else:
    print(math.ceil(w*h/2))
H, W = map(int, input().split())
if H == 1 or W == 1:
    ans = 1
else:
    ans = W * (H//2) + (W + 1) // 2 * (H % 2)
print(ans)
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)
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)
a, b = map(int, input().split())

c = a*b
if a == c:
  print(1)
elif b == c:
  print(1)
elif c % 2 == 0:
  print(int(c/2))
else:
  print(int(c/2)+1)
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    exit()
if h%2==1 and w%2==1:
    print((h*w+1)//2)
else:
    print(h*w//2)
import math
h,w=map(int,input().split())

if h==1 or w==1:
    print(1)
else:
    print(math.ceil(h*w/2))
H, W = map(int, input().split())

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

print(result)
from math import ceil
H,W=map(int,input().split())

if (H!=1)and(W!=1):
    print(ceil((H*W)/2))
else:
    print("1")
import math
H,W = map(int,input().split())

if H == 1 or W == 1:
    ans = 1
else:
    ans = math.ceil(H * W / 2)

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

if h == 1 or w == 1:
  print(1)
elif h*w%2 == 1:
  print(1+h*w//2)
else:
  print(h*w//2)
h, w= list(map(int, input().split()))
if h == 1 or w == 1:
    print(1)
else:
    ans = h*w/2
    if ans == int(ans):
        print(int(ans))
    else:
        print(int(ans + 0.5))
H,W=map(int,input().split())
def ABC(a):
    if a%2==1:
        return (a//2)+1
    elif a%2==0:
        return a//2
if H>1 and W>1:
    ans=(H//2)*(W//2)+(ABC(H)*ABC(W))
    print(ans)
else:
    print(1)
h,w=map(int,input().split())
print(-(-(h*w)//2) if h!=1 and w!=1 else 1)
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)+1)/2))
import math
a=input().split(' ')
if(int(a[0])==1):
    print(1)
else:
    if(int(a[1])==1):
        print(1)
    else:
        print(math.ceil(int(a[0])*int(a[1])/2))
# coding: utf-8
import math

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

m = (h * w)

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

if m % 2 == 0:
    print(int(m / 2))
else:
    print(math.floor(m / 2) + 1)
H,W = map(int,input().split())
if H==1:
  print(1)
else:
  if W==1:
    print(1)
  elif W==2:
    print(H)
  else:
    if W%2==0:
      print((W//2)*H)
    else:
      if H%2==0:
        print(((W//2)+1)*(H//2) + (W//2)*(H//2))
      else:
        print(((W//2)+1)*((H//2)+1) + (W//2)*(H//2))
def resolve():
    from math import ceil
    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(ceil(h * w / 2)))


resolve()
import math
H,W = list(map(int, input().split()))

if H == 1 or W == 1:
  print(1)
else:
  print(math.ceil(H*W/2))
h, w = [int(x) for x in input().split()]
if h == 1 or w == 1:
    res = 1
else:
    if w%2 == 0:
        res = h * w // 2
    else:
        res = h * (w//2) + (h + 2 - 1)//2
print(res)
#!/usr/bin/env python3

import math
from decimal import *

def main():
    h,w = map(int, input().split())
    if h == 1:
        print(1)
        exit()
    elif w ==1:
        print(1)
        exit()
    else:
        print(math.ceil(h*w/2))

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

import math

if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil(H * W / 2))
h,w = map(int,input().split())

if h == 1 or w == 1:
    ans = 1
else:
    if (h*w) % 2 == 0:
        ans = int(h*w/2)
    else:
        ans = int(h*w//2 +1)
        
print(ans)
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    exit()
print(-(-h*w//2))
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)
h, w = list(map(int, input().split()))

if h == 1 or w == 1:
    print(1)
else:
    print((h*w+1)//2)
h,w = (int(x) for x in input().split())


num  = 1
if h != 1 and w != 1:
    num = ((w // 2) + (w % 2))*( (h // 2) + ( h% 2) ) + ((w // 2) + (w % 2)-(w%2))*( (h // 2) + (h%2) -(h%2)) 
print(num)
H,W = map(int,input().split())
if H == 1 or W == 1:
    ans = 1
elif H%2 == 0:
    ans = (H//2)*W
else:
    ans = (H//2)*W + (W+1)//2
print(ans)
h,w=map(int,input().split());print([0--h*w//2,1][h<2 or w<2])
import sys
h,w = map(int, input().split())
 
if h == 1 or w == 1:
  print(1)
  sys.exit(0)
  
if (h*w) % 2 == 0:
  print((h*w)//2)
else:
  print((h*w)//2 + 1)
import sys
readline = sys.stdin.readline

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

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

a = h * w

if h == 1 or w == 1:
    print("1")
else:
    if a % 2 == 0:
        print(a // 2)
    else:
        print((a // 2) + 1)
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print((h*w)//2 + (h*w)%2)
H,W=map(int,input().split())
if H%2==0:
  ans=int(H*W/2)
elif W==1 or H==1:
  ans=1
else:
  ans=int((H-1)*W/2+1+(W-1)//2)
print(ans)
h,w=input().split(" ")
h,w=int(h),int(w)
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))
w,h = map(int, input().split())
x = w*h

if h !=1 and w != 1:
    print((h*w+1)//2)
else:
    print(1)
h,w=map(int,input().split())
a=h*w
if h!=1 and w!=1:
  if a%2==0:
    print(a//2)
  else:
    v=(a-1)//2
    print(a-v)
else:
  print(1)
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)
def main():
    H,W = map(int,input().split())
    N = H*W
    #print(N//2)

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

    return ans

print(main())
[H, W] = list(map(int, input().split()))
area = H*W
if H == 1 or W == 1:
  print(1)
else:
  if area%2 == 0:
    print(int(area/2))
  if area%2 == 1:
    print(area//2 + 1)
h, w = map(int,input().split())

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

print(count)
# B - Bishop

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

ans = W * (H//2)
if H&1:
    ans += (W+1)//2

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

print(ans)
(n, m) = map(int, raw_input().split())

res = 0

if n == 1 or m == 1:
    print 1
else:
    res += ((n + 1) / 2) * ((m + 1) / 2)
    res += (n / 2) * (m / 2)
    print res
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-1)/2+(H/2+1)))
H,W = [int(n) for n in input().split()]
if H < 2:
  W = 1
if W < 2:
  H = 1
print((H*W//2) if H*W%2==0 else ((H*W+1)//2))
h,w=map(int,input().split())
if h==1 or w==1:
  ans=1
else:
  ans=(h*w)//2
  if h*w%2==1:
    ans+=1
print(ans)
m,n=map(int,input().split())
res=m*n
if m==1 or n==1:
    print(1)
else:
  if res%2==0:
     print(res//2)
  else:
     print((res//2)+1)
import numpy as np
import sys
h,w = map(int,input().split())
if h == 1:
    print(1)
    sys.exit()
if w == 1:
    print(1)
    sys.exit()
if w%2 == 0:
    if h%2 == 0:
        print((w//2)*h)
    else:
        print((w//2)*h)
else:
    if h%2 == 0:
        print(((w//2)+1)*(h//2) + (w//2)*(h//2))
    else:
        print(((w//2)+1)*((h//2)+1) + (w//2)*(h//2))
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)
import sys

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

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

print(int((h * w + 1)/2))
def main():
    

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


if __name__ == "__main__":
    main()
a, b = map(int, input().split())

c = (a + 1) // 2
d = a // 2

e = (c + d) * (b // 2)

if a == 1 or b == 1:
    print(1)
else:
    print(e if b % 2 == 0 else e + c)
a , b = map(int , input() . split())
if a == 1 or b == 1 :
    print(1)
elif a * b % 2 == 0 :
    print(a * b // 2)
else :
    print(a * b // 2 + 1 )
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))
h, w = [int(i) for i in input().split()]
 
if h == 1 or w == 1:
  print(1)
elif h % 2 == 0:
  print((h // 2) * w)
else:
  if w % 2 == 0:
    print((w // 2) * h)
  else:
    print((w//2 + 1) * (h//2 + 1) + (w//2) * (h//2))
import math
a,b=map(int,input().split())
int(a)
int(b)
c=a*b
int(c)
if a==1 or b==1:
    print(1)
elif c%2==0:
    d = c/2
    print(int(d))
else:
    d = math.floor(c/2) + 1
    print(int(d))
h,w = map(int, input().split())

if h==1 or w==1:
    print(1)
elif h%2 and w%2:
    print((h*w+1)//2)
else:
    print(h*w//2)
h,w = map(int, input().split())
if h!=1 and w!=1: print(-(-h*w//2))
else:print('1')
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))
import math
H,W = map(int,input().split())
all = H*W
if H == 1 or W == 1:
    print(1)
    exit()

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

if H == 1 or W == 1:
  ans = 1
else:
  if (H*W)%2 == 0:
    ans = int((H*W)/2)
  else:
    ans = int((H*W+1)/2)
print(ans)
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()
import math

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

if h == 1 or w == 1:
    print(1)
else:
    print(math.ceil((h*w)/2))
h,w=map(int,input().split())
if (h==1 and w!=1) or (h!=1 and w==1):
    print(1)
else:
    m=h*w
    print((m+2-1)//2)
H, W = map(int, input().split())

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

if H == 1 or W == 1:
    print(1)
else:
    q,r = divmod(H*W, 2)
    print(q+r)
value = input().split()
rows = int(value[0])
colmuns = int(value[1])

#valid
if colmuns == 1:
  rows = 1
elif rows == 1:
  colmuns = 1

OddColNum = colmuns // 2 
EvenColNum = OddColNum
if (colmuns % 2) != 0:
  OddColNum = OddColNum + 1
if (colmuns == 1):
  OddColNum = 1

OddRowCount = 0
EvenRowCount = rows // 2
if (rows % 2) == 0:
  OddRowCount = rows // 2
else:
  OddRowCount = (rows // 2) + 1
if (rows == 1):
  OddRowCount = 1

counts = OddRowCount * OddColNum + EvenColNum * EvenRowCount
print(counts)
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
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))
h , w = map(int, input().split())
if h == 1 or w == 1: exit(print(1))
a1 = h//2 + 1 if h % 2 != 0 else h//2
a2 = h - a1
a3 = w//2 + 1 if w%2!=0 else w//2
a4 = w - a3
#print(a1 , a2 , a3,a4)
ans = a1*a3 + a2*a4
print(ans)
import sys

h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
  sys.exit()

if h % 2 == 1 and w % 2 == 1:
  print(int(h*w//2 + 1))
else:
  print(int(h*w//2))
import math
h, w = list(map(int,input().split()))
if h != 1 and w != 1:
	print(math.ceil((h*w)/2))
else:
	print(1)
h,w = map(int,input().split())

s = (h * w) // 2

if (h==1) or (w==1):
    t = 1
elif (h*w) % 2 == 0:
        t = s
elif (h*w) % 2 == 1:
        t = s+1

print (t)
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
    exit(0)
elif H % 2 != 0 and W % 2 != 0:
    print((H * W // 2) + 1)
else:
    print(H * W // 2)
# Panasonic2020 B

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

if h == 1 or w == 1:
    print(1)
elif (h * w) % 2:
    print(1 + (h * w) // 2)
else:
    print(h * w // 2)
h, w = map(int, input().split())
if w == 1 or h == 1:
	print(1)
else:
	print(((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2))
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)
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
if H > 1 and W > 1:
    print((H * W) // 2 + (H * W) % 2)
else:
    print(1)
import sys

H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    sys.exit()

a = H * W
if a % 2 == 0:
    answer = a // 2
else:
    answer = a // 2 + 1
print(answer)
a,b=map(int,input().split())
if a==1 or b == 1:
  print(1)
else:
  print((a*b+1)//2)
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
else:
  if w % 2 == 0:
      a = (w//2) * 2
      if h % 2 == 0:
          count = a * (h//2)
      else:
          count = a * (h//2)
          count += a // 2
  else:
      a = (w//2) * 2 + 1
      if h % 2 == 0:
          count = a * (h//2)
      else:
          count = a * (h//2)
          count += a//2+1

  print(count)
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
#input = sys.stdin.readline


#N=int(input())

#A=list(map(int,input().split()))
#XY=[list(map(int,input().split())) for i in range(N)]

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

if h == 1 or w == 1:
    print(1)
else:
    import math
    h_odds = math.ceil(h / 2)
    h_evens = h // 2
    w_odds = math.ceil(w / 2)
    w_evens = w // 2
    print(h_odds * w_odds + h_evens * w_evens)
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
else:
  print(H*W//2 if H*W%2==0 else H*W//2+1)
h,w=map(int,input('').split(' '))
masu=0

masu=masu+(w*(h//2))

if h%2==1:
    if w%2==1:
        masu=masu+(w//2)+1
    else:
        masu=masu+(w//2)

if h==1 or w==1:
    masu=1

print(masu)
n,m = map(int,input().split())
ans = n*m
if n ==1 or m==1:
    print(1)
else:
    if ans%2==0:
        print(ans//2)
    else:
        print((ans+1)//2)
h, w = map(int, input().split())
ans = (h * w + 1) // 2
if h == 1 or w == 1:
    ans = 1
print(ans)
#coding:utf-8
h, w = map(int, input().split())
area = h * w

if h == 1 or w == 1:
    print(1)
elif area % 2 == 0:
    print(area // 2)
else:
    print(-(-area // 2))
import sys
H,W=[int(i) for i in input().split(" ")]

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

print((H*W+1)//2)
import sys
h,w=map(int,input().split())
if(h==1 or w==1):
    print(1)
    sys.exit()
if((h*w)%2):
    print(int((h*w)//2+1))
else:
    print(int((h*w)//2))
import math
h, w = map(int, input().split())

if(h == 1 or w == 1):
    print(1)
else:
    print(math.ceil(h*w/2))
H,W = map(int,input().split())
ans = 0
wx = W // 2
hx = H // 2
wy = W % 2
hy = H % 2

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

if wy == 0 and hy == 0:
  ans = (W * H) / 2
elif wy == 1 and hy == 0:
  ans = (((W-1)*H)/2) + (H / 2)
elif wy == 0 and hy == 1:
  ans = ((W*(H-1))/2) + (W / 2)
else:
  ans = (((W-1)*(H-1))/2) + ((W-1) / 2) + ((H-1) / 2) + 1
print(int(ans))
import sys
input = sys.stdin.readline
H, W = map(int, input().split())
if H == 1 or (W == 1): print(1)
else: print(-(-(H * W) // 2))
import math

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

if H == 1 or K == 1:
  print(1)
else:
  print(math.ceil((H * K)/2))
a, b = map(int,input().split())

if a==1 or b==1:
    print(1)
elif a%2 ==1 and b%2 ==1:
    print(a*b//2 +1)
else:
    print(a*b//2)
#!/usr/bin/env python3
x,y=list(map(int,input().split()))
if x==1 or y ==1:
    print(1)
else:
    print(-(-x*y//2))
nums =input().rstrip().split(" ")
tate=int(nums[0])
yoko=int(nums[1])
if tate==1 or yoko==1:
    masu=1
elif yoko%2==0:
    masu=int(yoko/2)*tate
elif yoko%2==1:
    masu=yoko*int(tate/2)+(tate%2)*int((yoko+1)/2)
print(masu)
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print((h*w+1)//2)
H,W=map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(W*(H//2)+H%2*(W//2+W%2))
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
    exit()
if ((H * W) % 2) == 0:
    print(H * W // 2)
else:
    print(H * W // 2 + 1)
H, W = map(int, input().split())
a = H*W
if H == 1 or W == 1:
    print(1)
else:
    print(-(-a//2))
#!python3.4.3

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

s = h * w

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

if s%2 == 0:
  print(s//2)
else:
  print(s//2 + 1)
H, W = [int(x) for x in input().split()]
if (H==1 or W==1):
    print(1)
else:
    print(((H+1)//2) * ((W+1)//2) + (H//2) * (W//2))
import math
h,w = map(int, input().split(' '))
if h == 1 or w == 1:
    print(1)
else:
    res = math.ceil(h*w / 2)
    print(res)
import math
h,w = map(int, input().split())
if h == 1 or w == 1:
  a = 1
else:
  a = math.ceil(h*w/2)
print(a)
import math

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

if(H==1 or W==1):
    n = 1
else:
    if(H%2==0 or W%2==0):
        n = int(H*W/2)
    else:
        n = int(H*(W-1)/2 + math.ceil(H/2))
        
print(n)
import sys
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
  sys.exit()
ans = h//2*w
if h%2 != 0:
  if w%2 != 0:
    ans += w//2+1
  else:
    ans += w/2
print(int(ans))
H, W = map(int, input().split())

if H !=1 and W !=1:
    answer = H * W // 2
    if H * W % 2 != 0:
        answer += 1
    print(answer)
else:
    print(1)
h,w = map(int,input().split())
print((int(h/2+0.5)*w-(h%2)*int(w/2))if(h-1)and(w-1)else 1)
H, W = map(int, input().split())
ans = (H*W+1)//2
if H == 1 or W == 1:
    ans = 1
print(ans)
x,y = map(int,input().split())
if x == 1 or y == 1:
	print(1)
else:
    print(int((x*y+1)/2))
h, w = map(int, input().split())
if h > 1 and w > 1 :
    print(h*w//2 + h*w%2)
else:
    print(1)
x,y=list(map(int,raw_input().split()))
w=x
h=y
if x==1 or y==1:
  print("1")
  exit(0)
ans=x//2 * (h//2 + (h+1)//2)
if x%2==1:
     ans+=(h+1)//2
print(ans)
h, w = list(map(int, input().split()))

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

odd = ((h+1)//2) * ((w+1)//2)
even = (h//2) * (w//2)

print(odd+even)
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
m=h//2
n=w//2

if h==1 or w==1:
    ans=1
elif h%2==0:
    ans=m*w
else:
    md=w%2
    ans=n*(m+1+m)+md*(m+1)
print(ans)
h,w = map(int,input().split())

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

if h*w % 2 == 1:
  if h == 1 or w == 1:
    print(1)
  else:  
    print(h*w//2+1)
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)
H, W = input().split(' ')
H = int(H)
W = int(W)
if H==1 or W ==1:
  print(1)
elif (H%2)==0 and (W%2)==0:
  print(int((H/2) * W))
elif (H%2)==1  and (W%2)==0:
  print(int((W/2) * H))
elif (H%2)==0 and (W%2)==1:
  print(int((H/2) * W))
elif (H%2)==1 and (W%2)==1:
  print(int((H*W//2)+1))
H,W = map(int,input().split())

ans = H * W // 2
if H % 2 != 0 and W % 2 != 0:
    ans += 1
    
if W == 1 or H == 1:
    ans = 1
print(ans)
h, w = map(int, input().split())
if  h == 1 or w == 1:
    ans = 1
elif h % 2 == 0:
    ans = h // 2 * w
else:
    if w % 2 == 0:
        h_a = h//2 + 1
        ans = (h_a * 2 - 1) * w//2 
    else:
        h_a = h // 2 + 1
        ans = (h_a * 2 - 1) * (w//2) + h_a

print(ans)
import math

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

if H != 1 and W != 1:
	print(math.ceil(H * W / 2))
else:
	print(1)
import math
if __name__ == '__main__':
    h, w = map(int, input().split())
    a = 1 if h == 1 or w == 1 else h * w // 2 if h * w % 2 == 0 else h * w // 2 + 1
    print(a)
h,w = map(int, input().split())
if h == 1 or w==1:
  print(1)
else:
  print((h*w+1)//2)
n,m=map(int,input().split())
if n==1 or m==1:
  print(1)
  exit()
print(m//2*n+m%2*(n//2+n%2))
H, W = list(map(int, input().split()))

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

print((H * W + 1) // 2)
import math


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

if n[0] == 1 or n[1] == 1:
  print('1')
  
else:
  print(math.floor((n[0] * n[1] + 1)/ 2))
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 // 2 + 1)
else:
	print(h * w // 2)