def get_tree_size(cur):
    """
    Return the total amount of tree nodes.
    """
    sql = """
      SELECT
        COUNT(*)
      FROM
        nodes;
    """
    cur.execute(sql)
    result = cur.fetchone()
    return result['count']
