async def METHOD_NAME(
    map_md5: Optional[str] = None,
    mods: Optional[int] = None,
    status: Optional[int] = None,
    mode: Optional[int] = None,
    user_id: Optional[int] = None,
) -> int:
    query = """\
        SELECT COUNT(*) AS count
          FROM scores
         WHERE map_md5 = COALESCE(:map_md5, map_md5)
           AND mods = COALESCE(:mods, mods)
           AND status = COALESCE(:status, status)
           AND mode = COALESCE(:mode, mode)
           AND userid = COALESCE(:userid, userid)
    """
    params = {
        "map_md5": map_md5,
        "mods": mods,
        "status": status,
        "mode": mode,
        "userid": user_id,
    }
    rec = await app.state.services.database.fetch_one(query, params)
    assert rec is not None
    return rec["count"]