import aiohttp
import json


async def get_latest_comic_num() -> int:
    """Fetches the number of the latest xkcd comic.

    Returns:
        number (int): The latest comic number
    """
    async with aiohttp.ClientSession() as session:
        async with session.get("https://xkcd.com/info.0.json") as resp:
            unparsed = await resp.read()
    data = json.loads(unparsed.decode())
    number = data["num"]
    return int(number)