def barcode_size(codes):
    """Returns the barcode size in modules."""
    num_rows = len(codes)
    num_cols = len(codes[0])

    # 17 bodules per column, last column has an additional module
    width = num_cols * 17 + 1
    height = num_rows

    return width, height