def _get_totalpath_address(metadata, page_number):
    """Returns total path address of the given page number.

    Returns
    -------
    int
        total path address
    """
    if 'TOTALPATH' in metadata.pages[page_number]:
        address = int(metadata.pages[page_number]['TOTALPATH'])
    else:
        address = 0
    return address