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):

from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    h, w = [int(s) for s in input().strip().split()]
    if h == 1 or w == 1:
        print(1)
        return
    result = h * (w // 2) + (w % 2) * (h + 1) // 2
    print(result)




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

Solution (Python):

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

Solution (Python):
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

H, W = map(int, input().split())
if H >= 2 and W >= 2:
    ans = math.ceil(H / 2) * math.ceil(W / 2) + (H // 2) * (W // 2)
else:
    ans = 1
print(ans)

Solution (Python):
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)

Solution (Python):
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

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

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

n = a*b

if a == 1 or b == 1:
    print(1)
elif n % 2 == 1:
    print(n//2 + 1)
else:
    print(n//2)

Solution (Python):


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

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

if __name__ == "__main__":
    main()

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

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


if __name__ == '__main__':
    main()

Solution (Python):
H, W = list(map(int, input().split()))
n1 = None
n2 = None
if W % 2 == 0:
    n1 = W // 2
    n2 = n1
else:
    n1 = W // 2 + 1
    n2 = n1 - 1
o1 = None
o2 = None
if H % 2 == 0:
    o1 = H // 2
    o2 = H // 2
else:
    o1 = H // 2 + 1
    o2 = H // 2
if min(H, W) > 1:
    print(n1 * o1 + n2 * o2)
else:
    print(1)

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Solution (Python):




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


hw = h * w
if h == 1 or w == 1:
    ans = 1
else:
    if hw % 2 == 0:
        ans = hw // 2
    else:
        ans = hw // 2 + 1


print(ans)

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

total = H * W
if(H > 1 and W > 1):
    print(math.ceil(total / 2))
else:
    print(1)

Solution (Python):
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))

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

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

Solution (Python):

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)

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

Solution (Python):
h, w = list(map(int, input().split(" ")))
if h != 1:
    if w != 1:
        ans = - (- (h * w) //2)
if h == 1:
    ans = 1
if w == 1:
    ans = 1
print(ans)

Solution (Python):
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)

Solution (Python):
import bisect, collections

def solution():
    h, w = [int(x) for x in input().strip().split(" ")]
    if w == 1 or h == 1:
        print(1)
    else:
        print(((h+1)//2)*((w+1)//2)+(h//2)*(w//2))
    



def main():    
    
    for _ in range(1):
        solution()
    

main()

Solution (Python):
h,w = [int(x) for x in 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)

Solution (Python):
import math

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

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

mini_w = int(w/2)
maxi_w = math.ceil(w/2)
mini_h = int(h/2)
maxi_h = math.ceil(h/2)
print(maxi_w*maxi_h + mini_w*mini_h)

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

oneloop = w

rest = (w-w//2)

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

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

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

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

if H!=1 and W!=1:
    h_1=-(-H//2)
    h_2=H//2

    answer=W//2*(h_1+h_2)

    if W%2==1:
        answer+=h_1
else:
    answer=1

print(answer)

Solution (Python):

import math

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

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

    odd = math.ceil(H/2)
    even = H//2

    ans = odd*math.ceil(W/2) + even*(W//2)
    print(ans)


if __name__ == "__main__":
    solve()

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

Solution (Python):
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)

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

a, b = divmod(H*W, 2)

if H==1 or W==1:
    print(1)
else:
    if b==0:
        print(a)
    else:
        print(a+1)

Solution (Python):
a=input().split()
H,W=int(a[0]),int(a[1])
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):


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)

Solution (Python):
import sys
input = sys.stdin.readline
def linput():
    return list(map(int, input().split()))

def main():
    
    N,M = linput()
    
    
    

    
    if N%2 and M%2:
        res = -(-N*M//2)
    else:
        res = N*M//2

    if N==1 or M==1:
        res = 1

    print(res)

main()

Solution (Python):

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

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

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

Solution (Python):
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)

Solution (Python):
[H,W] = [int(s) for s in input().rstrip().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):
H, W = map(int, input().split())
if H == 1 and W > 1 or W == 1 and H > 1:
  print('1')
else:
  print(int(H*W/2+0.5))

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))

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

Solution (Python):










import math
import numpy as np
import statistics
import string
import sys
from array import array
from collections import deque

def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

H,W = splitintinput()

if H == 1 or W == 1:
    print(1)
    exit()
if H % 2 == 0:
    print(int(H*W/2))
else:
    print(int((H-1)*W/2 + math.ceil(W/2)))

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

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

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    H,W=map(int,readline().split())

    if H==1:
        print(1)
    elif W==1:
        print(1)
    elif H%2==0:
        print(H*W//2)
    elif H%2==1:
        if W%2==0:
            print(H*W//2)
        elif W%2==1:
            print((H//2)*(W//2)+(H//2+1)*(W//2+1))
if __name__=="__main__":
    main()

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
h,w = map(int,readline().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//2)+(h//2+1)*(w//2))
    else:
        print((h//2+1)*(w//2+1)+(h//2)*(w//2))

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

Solution (Python):
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)

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())

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

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

Solution (Python):

import sys

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

if h % 2 == 0 or w % 2 == 0:
    ans = h * w // 2
else:
    ans = h * w // 2 + 1

print(ans)

Solution (Python):
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') 
def gcd(a,b):return fractions.gcd(a,b) 
def lcm(a,b):return (a*b) // fractions.gcd(a,b) 
def iin(): return int(sys.stdin.readline()) 
def ifn(): return float(sys.stdin.readline()) 
def isn(): return sys.stdin.readline().split() 
def imn(): return map(int, sys.stdin.readline().split()) 
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) 
def fmn(): return map(float, sys.stdin.readline().split()) 
def iln(): return list(map(int, sys.stdin.readline().split())) 
def iln_s(): return sorted(iln()) 
def iln_r(): return sorted(iln(), reverse=True) 
def fln(): return list(map(float, sys.stdin.readline().split())) 
def join(l, s=''): return s.join(l) 
def perm(l, n): return itertools.permutations(l, n) 
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) 
def comb(l, n): return itertools.combinations(l, n) 
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) 
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 
def m_add(a,b): return (a+b) % MOD

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

H,W = imn()

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

Solution (Python):



import sys
sys.setrecursionlimit(10000000)



def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    H,W=pin()
    if H>1 and W>1:
        print((H*W+1)//2)
    else:
        print(1)
"""


"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """4 5"""
        output = """10"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """7 3"""
        output = """11"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1000000000 1000000000"""
        output = """500000000000000000"""
        self.assertIO(input, output)
if __name__=="__main__":resolve()

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 sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

H, W = LI()

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

Solution (Python):
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

H, W = MAP()

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


print(ans)

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

Solution (Python):
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

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

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

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

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

print(x)

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

if a == 1 or b ==1:
  print(1)
else:
  print(math.ceil(a*b /2))

Solution (Python):
if __name__ == "__main__":
    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)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





h,w=mii()

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

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

Solution (Python):
def inpl():
    return list(map(int, input().split()))


HW = inpl()
HW.sort()
if HW[0] == 1:
    print(1)
    exit()
print(HW[0] * HW[1] // 2 + int(HW[0] % 2 == 1 and HW[1] % 2 == 1))

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
if H == 1 or W == 1:
    print(1)
else:
    print((H // 2 + H % 2) * (W // 2 + W % 2) + (H // 2) * (W // 2))

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
import math
import sys
input = sys.stdin.readline

sys.setrecursionlimit(2147483647)

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

if __name__ == '__main__':
  main()

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

import math

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

Solution (Python):
H, W = [int(s) for s in 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)

Solution (Python):
def sol(h, w):
    if h == 1 or w == 1:
        return 1
    a = (w+1) // 2
    b = w // 2
    res = (a+b) * (h//2)
    if h & 1:
        res += a
    return res

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

if __name__ == '__main__':
    main()

Solution (Python):
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)

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))

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

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

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)+1)/2))

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

Solution (Python):
import sys
import math
import collections
from collections import deque

h, w = map(int, sys.stdin.readline().split())


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

Solution (Python):




def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    h, w = rli()
    if h == 1 or w == 1:
        print(1)
        return
    ans = (h*w)//2
    if (h*w%2 == 1): ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
import math

H, W = map(int, input().split())
if W == 1 or H == 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())

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

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

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

Solution (Python):
H, W = map(int, raw_input().split())
if H==1 or W==1:
  print 1
else:
  print (H*W+1)/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 = list(map(int,input().split()))
l,m = 0,0
if h % 2 == 1:
    l = h // 2 + 1
else:
    l = h // 2
if w % 2 == 1:
    m = w // 2 + 1
else:
    m = w // 2
if h == 1 or w == 1:
    print(1)
else:
    print(w*h - l * (w // 2) - m * (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):
import math
h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
else:
  print(math.ceil(h * w / 2))

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Solution (Python):
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)

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

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

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

Solution (Python):
import sys
from math import ceil, floor
h, w  =[int(i) for i in sys.stdin.readline().split()]
if h == 1 or w == 1:
    print(1)
else:
    print(ceil(h / 2) * ceil(w / 2) + (h - ceil(h / 2)) * (w - ceil(w / 2)))

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

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

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):
H,W = list(map(int,input().split()))
t = H*W


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

Solution (Python):
import sys
H,W=map(int,input().split())
if H>W:
    H,W=W,H
if H==1:
    print(1)
    sys.exit()
num=H*W
if num%2==0:
    print(num//2)
else:
    print(num//2+1)

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):

from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"




def main():
    a,b,c = mi()
    if c-a-b<=0:
        print(no)
        exit()
    else:
        if (c-a-b)**2 > 4*a*b:
            print(yes)
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "YES"
no = "NO"




def main():
    a,b = mi()
    if a == 1 or b == 1:
        print(1)
        exit()
    ans = 0
    ans+=((a+1)//2)*((b+1)//2)
    ans+=(a//2)*(b//2)
    print(ans)

        
    


main()

Solution (Python):
from math import ceil

H, W = map(int, input().split())
if 1 in [H, W]:
    print(1)
else:
    print(ceil(H*W/2))

Solution (Python):
from math import *

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

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

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

Solution (Python):
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)

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

Solution (Python):
H,W = [int(i) for i in input().split()]
if H != 1 and W != 1:
    N = H*W
    if N % 2 == 1:
        N-=1
        print(N//2 + 1)
        exit()
    if N%2 ==0:
        print(N//2)
else:
    print(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):
H, W = map(int, input().split())
L, R = 0, 0
if H % 2 == 0:
  L = H // 2
  R = H // 2
else:
  L = H // 2 + 1
  R = H // 2
S = 0
if W % 2 == 0:
  S = (L + R) * (W // 2)
else:
  S = (L + R) * (W // 2) + L
if W != 1 and H != 1:
  print(S)
else:
  print(1)

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

if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):
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)

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

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

Solution (Python):
def main():
    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)


if __name__ == '__main__':
    main()

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

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

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