peterverebics/CodeNet_Python_118 huggingface dataset:
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)
h,w=map(int,input().split())
if h ==1 or w == 1:
    print(1)
    exit()
ans = (w+1)//2*((h+1)//2) + (w//2) * (h//2)
print(ans)
n, m = map(int, input().split())
if n == 1 or m == 1:
    print(1)
else:
    r = (n * m) // 2
    if (n * m) % 2 == 0:
        print(r)
    else:
        print(r+1)
a,b = (int(x) for x in 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:
    print((H*W+1)//2)
h, w = map(int, input().split())
x = (h * w) % 2
if h == 1 or w == 1:
    print(1)
elif x == 0:
    print((h * w) // 2)
else:
    print(((h * w) // 2) + 1)
import sys
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
    sys.exit()
if w % 2 == 0:
    a = w // 2
else:
    a = (w // 2) + 1

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

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

import sys

a = (W+1)//2+(W//2)

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

if H%2 == 0:
    print(a*(H//2))
else:
    print(a*(H//2)+(W+1)//2)
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
  print(1)
else:
  print(math.ceil(H*W/2))
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
elif H % 2 == 1 and W % 2 == 1:
    print(math.ceil(H*W/2))
else:
    print(int(H*W/2))
H, W = [int(n) for n in input().split()]
if H == 1 or W == 1:
    print(1)
elif H%2 == 0:
    print(H*W//2)
else:
    h = (H+1)//2
    h_ = h-1
    if W%2 == 0:
        print((h+h_)*W//2)
    else:
        print((h+h_)*(W//2) + h)
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
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    H, W = list(map(int, sys.stdin.readline().split()))

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


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

print(math.ceil(ans))
import sys
input = sys.stdin.readline


def read():
    H, W = map(int, input().strip().split())
    return H, W

def solve(H, W):
    if H == 1 or W == 1:
        return 1
    n = H * W
    return n // 2 + n % 2

if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))
h, w = map(int, input().split())

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


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

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

if h%2:
      H=h//2+1
      print(H*w-(w//2))
      exit()
else:
      H=h//2
      print(H*w)
      exit()
h,w = map(int,input().split())
if h == 1 or w == 1:
    print(1)
elif h*w % 2 == 1:
    print((h*w//2)+1)
else:
    print(h*w//2)
def ceildiv(a, b):
    return -(-a // b)

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

if (h==1 or w==1):
    print(1)
else:
    r0 = ceildiv(w,2)
    r1 = w//2
    r0s = ceildiv(h,2)
    r1s = h//2
    print(r0*r0s + r1*r1s)
h, w=map(int,input().split())
if (w == 1) | (h == 1):
    print(1)
elif h % 2 == 0:
    print(int(h * w / 2))
elif h % 2 == 1 & w % 2 == 1:
    print(int((h - 1) * w / 2) + int(w / 2) + 1)
else:
    print(int((h - 1) * w / 2) + int(w / 2))
from sys import stdin
import numpy as np
from operator import itemgetter

#N = int(stdin.readline().rstrip().split()[0])
H, W = [int(x) for x in stdin.readline().rstrip().split()]
#A = [int(x) for x in stdin.readline().rstrip().split()]

MOD = 10**9 + 7
H_2 = H//2
W_2 = W//2

ans = W*H_2
if H%2 != 0:
  ans += W_2
  if W%2 != 0:
    ans += 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)
else:
    if W%2 == 1 and H%2 ==1:
        print((W*H+1)//2)
    else:
        print(W*H//2)
import sys
def LI():
	return [ int(s) for s in input().split() ]
 
H,W = LI()
 
if H == 1 or W == 1:
  print(1)
  sys.exit()
 
if H % 2 == 1 and W % 2 == 1:
  print(H*W//2+1)
else:
  print(H*W//2)
H, W = list(map(int, input().split()))
if H==1 or W==1:
    print(1)
    exit()
res = int((H+1)/2) * W
if H%2==1:
    res -= int(W/2)
print(res)
h,w = map(int,input().split())

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

print((w+1)//2*(h%2) + w*(h//2))
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    print((H*W+1)//2)
(w,h)=input().split()
w=int(w)
h=int(h)
d=w*h
if w!=1 and h!=1:
    if (w*h)%2==0:
        print(d//2)
    else:
        print((d+1)//2)
else:
    print(int('1'))
import math
h,w = map(int,input().split())
if h > 1 and w > 1:
    m = math.ceil(h * w /2)
else:
    m = 1
print(m)
H,W = [int(i) for i in input().split()]

h1 = H//2
h2 = H-h1

w2 = W//2
w1 = W-w2

if H==1 or W==1:
  print(1)
else:
  print(h2*w1+h1*w2)
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import ceil
def I(): return int(input())
def MI(): return map(int, input().split())

def main():
    H, W = MI()
    if H==1 or W==1:
        print(1)
    else:
        print(ceil(H*W/2))

if __name__ == '__main__':
    main()
h,w = map(int,input().split())

if h <= 1 or w <= 1:
    a = 1
else:
    a = (h*w)//2
    if (h*w)%2 != 0:
        a += 1
print(a)
HW = list(map(int,input().split()))
if all(x%2==1 for x in HW) and HW[0]>1 and HW[1]>1:
    print(int((HW[0]*HW[1]+1)/2))
elif HW[0] == 1 or HW[1] == 1:
    print(1)
else:
    print(int((HW[0]*HW[1])/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)
H, W = map(int, input().split())

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

print(ans)
import math
a , b = map(int , input() . split())
if a == 1 or b == 1 :
    print(1)
else :
    print(math . ceil(a * b / 2))
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	H, W = getlist()
	if H == 1 or W == 1:
		print(1)
		return

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

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


if __name__ == '__main__':
	main()
h,w=map(int,input().split())
if h!=1 and w!= 1:
  print(int(h*w/2) + w*h%2)
else:
  print(1)
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)
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)
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
else:
  if H==2 and W==2:
    print(2)
  else:
    if H*W%2==0:
      print(H*W//2)
    else:
      print((H*W+1)//2)
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

H, W = input_nums()

horizontal = 0
ans = 0

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


ans = (H // 2) * (W // 2) + (-(-H // 2)) * (-(-W // 2))

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

print(ans)
import numpy as np
import collections
import math

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


answer=0

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

answer = math.ceil(H*W/2)


print(answer)
h,w=input().split(' ')
h=int(h)
w=int(w)
if h==1 or w==1:
  print(1)
else:
  print(((h*w)+1)//2)
#a, b, m = list(map(int, input().split()))
#a = list(map(int, input().split()))
#b = list(map(int, input().split()))
import math
H, W = list(map(int, input().split()))
 
ans = math.ceil(W/2) * (math.ceil(H/2))
ans += (W // 2) * (H//2)

if H == 1 or W == 1:
  ans = 1
 
print(ans)
import math

def main():

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

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

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

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

w1, w2 = W // 2, W % 2
h1, h2 = H // 2, H % 2

if H > 1 and W > 1:
	num = 2 * w1 * h1 + w2 * h1 + w1 * h2 + w2 * h2 
else:
  num = 1
print(num)
import sys

x = list( map(int, input().split()) )
h = x[0]
w = x[1]

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


menseki = h*w//2
if h*w % 2 == 0:
    print(menseki)
else:
    print(int(menseki)+1)
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)
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)
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())
print(1 if H*W in [H,W] else W*(H//2)+(W//2+W%2)*(H%2))
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 print((H*W)//2+1)
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    ans = (math.ceil(H/2) * math.ceil(W/2)) + ((H//2)*(W//2))
    print(ans)
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)
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//2+1)
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)
import math
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(math.ceil(h*w/2)))
import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
  exit()
print(h*w//2 + (0 if h%2==0 or w%2==0 else 1))
h, w = [int(x) for x in input().split()]

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

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

elif h%2==1 and w%2==0:
  print((h*w)//2)
else:
  print((h*w)//2+1)
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

h,w = na()

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

print((h*w+1)//2)
s=input().split(" ")
H=int(s[0])
W=int(s[1])
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)
H,W=map(int,input().split())

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

i = h * w

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

if(i % 2 == 0):
    ans = i//2

elif (i % 2 == 1):
    ans = i//2 + 1

print(ans)
HW = list(map(int, input().split()))
H = HW[0]
W = HW[1]

if W==1 or H==1:
    A = 1
else:
    A = int((H+1)/2)*int((W+1)/2)+int((H)/2)*int((W)/2)
print(A)
h,w = map(int,input().split())
if w == 1:
    print(int(1))
elif h == 1:
    print(int(1))
else:
    if h %2 == 0:
        print(int(h*w /2))
    else:
        tmp = (h+1)/2#多いほうの行けるマス数
        tmp1 = (h-1)/2#少ないほうの行けるマス数
        if w %2 == 0:
            print(int(h*w/2))
        else:
            print(int(h*(w-1)/2 +tmp))
h, w = map(int, input().split())
ans = 0
ans += (h // 2) * (w // 2) * 2
if h % 2 != 0:
    ans += w // 2
if w % 2 != 0:
    ans += h // 2
if h % 2 != 0 and w % 2 != 0:
    ans += 1
if h == 1 or w == 1:
    ans = 1
print(ans)
import math
import sys
H,W = map(int,input().split())
#print(H,W)
if(H == 1 or W == 1):
    print(1)
    sys.exit()

set_num = int(H/2)
#print(set_num)
number = int(set_num * W)
#print(number ,set_num)
amari = H - int(set_num) * 2
#print(number,amari)
number += amari * math.ceil(W/2)
print(int(number))
h, w = map(int, input().split())

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

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

elif W % 2 !=0 and H %2 !=0:
    print(int(0.5*(W*H+1)))
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)
#!/usr/bin/env python
# coding: utf-8

# In[12]:


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


# In[14]:


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


# In[ ]:
h,w = map(int,input().split())
if h == 1 or w == 1:
    print(1)
    exit()
a = h*w
if a % 2 == 1:
    print(int((a+1)/2))
else:
    print(int(a/2))
def main():
    h, w = map(int, input().split())
    ans = 0
    if h == 1 or w == 1:
        print(1)
        exit()
    
    if h % 2 == 0:
        ans = h * w // 2
    else:
        if w % 2 == 0:
            ans = h * w // 2
        else:
            ans = h * w // 2 + 1 
    print(ans)

if __name__ == '__main__':
    main()
import math

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

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

odd = int(math.ceil(W / 2.0) * math.ceil(H / 2.0))
even = int(math.floor(W / 2) * math.floor(H / 2))

print(odd + even)
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)+(H//2)*(W//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)
H, W = map(int, input().split())
re = H // 2
ro = (H + 1) // 2
ce = W // 2
co = (W + 1) // 2
print(1 if H == 1 or W == 1 else re * ce + ro * co)
h, w = map(int, input().split())

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

if (h * w) % 2 == 0:
    print((h*w)//2)
else:
    print((h*w)//2+1)
N,M = map(int,input().split())
if(N>1 and M >1):
	print((N*M+1)//2)
else:
  print(1)
h, w = map(int, input().split())
if h==1 or w==1:
    print(1)
elif h%2 ==0 or w%2==0:
    print(w*h//2)
else:
    print(w*(h//2)+(w+1)//2)
import math

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

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

    if h % 2 == 1:
        ans += math.ceil(w/2)

    print(ans)
H, W = map(int, input().split())
if H==1 or W==1:
    print(1)
elif H %2 != 0 and W%2 != 0:
    print(H*W//2 + 1) 
else:
    print(H*W//2)
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    h,w=map(int,input().split())
    if h==1 or w==1:
        print(1)
        sys.exit()
    if h*w%2==0:print(h*w//2)
    else:print((h*w+1)//2)

if __name__=='__main__':
    main()
import sys

H, W = map(int, sys.stdin.readline().strip().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 // 2 + 1)
import math
h, w = [int(x) for x in input().split()]

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

x = h//2 if h%2==0 else h//2+1
y = w//2 if w%2==0 else w//2+1

print(1 if h==1 or w==1 else x*y+(h-x)*(w-y))
h,w = [int(i) for i in input().split()]
 
if h == 1 or w == 1:
  print(1)
else:
  print(h * w // 2 + 1 if h * w % 2 else h * w //2 )
h, w = map(int, input().split())
if h == 1 or w == 1:
    ans = 1
else:
    ans = (h // 2 + h % 2) * (w // 2 + w % 2) + (h // 2) * (w // 2)
print(ans)
import sys
input=sys.stdin.readline
from math import *
n,m=map(int,input().split())
if n==1 or m==1:
    print(1)
else:    
    print(int(ceil((n*m)/2)))
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    # 一般に、正整数 x, y に対し、x/y を切り上げた値は (x + y − 1)//y 
    # (// は整数除算) として実装できる
    # この場合H*W+2-1
    print((H*W+1)//2)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

if min(H, W) == 1:
    print(1)
    exit()

ans = W * (H // 2)

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

print(ans)
h,w = map(int, raw_input().split(' '))
def f(h,w):
	if h == 1 or w == 1:
		return 1
	x = w - w/2
	y = w/2
	count = 0
	count += (h - (h/2)) * x
	count += ((h/2)) * y
	return count
		


print f(h,w)
import sys

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

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

if M == 1 or N == 1:
  print(1)
elif M * N % 2 == 1:
    print(M * N // 2 + 1)
elif M*  N % 2 == 0:
    print(M * N // 2)
H, W = [int(i) for i in 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())
a=0
if h==1 or w==1:
    a=1
elif h%2==1 and w%2==1:
    a=int(h*w/2)+1
else:
    a=int(h*w/2)

print(a)
H, W = map(int,input().split())
ans = 0

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

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

if H == 1 or W == 1:
    ans = 1
else:
    ans = ((H + 2 - 1) // 2) * ((W + 2 - 1) // 2) + (H // 2) * (W//2)
print(ans)
import math

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

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

if min(H,W)==1:
  print(1)
else:
  ans=(W//2+W%2)*(H//2+H%2)+(W//2)*(H//2)
  print(int(ans))
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:
  print((H*W+1)//2)
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)
    exit()
if w%2==0: a = w//2
else: a = w//2+1

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

def solve():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    if H == 1 or W == 1: print(1)
    else: 
        Ans = (H // 2 + H % 2) * (W // 2 + W % 2) + (H // 2) *  (W // 2)
        print(Ans)

    return 0

if __name__ == "__main__":
    solve()
h,w = map(int,input().split())
t = w//2+(w%2!=0)
ans  = (t+w//2)*(h//2)+t*(h%2!=0)
if h == 1 or w == 1:
    print(1)
    exit()
print(ans)
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    if H % 2 == 0:
        e_h = H // 2
        o_h = H // 2
    else:
        e_h = H // 2 + 1
        o_h = H // 2
    if W % 2 == 0:
        print(e_h * (W // 2) + o_h * (W // 2))
    else:
        print(e_h * (W // 2 + 1) + o_h * (W // 2))
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)
import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 32


def lmi():
    return list(map(int, input().split()))


def llmi(n):
    return [lmi() for _ in range(n)]


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

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

H = int(H)
W = int(W)

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

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

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