import re
import functools
import operator


def num_cells(size):
    """
    Return grid size in cells out of Size definition e.g. "15X15R"
    """
    size_l = re.findall('\d+', size)
    return functools.reduce(operator.mul, [int(i) for i in size_l], 1)