<｜begin▁of▁sentence｜>### Instruction:
Given the Network Science coauthorship graph which you can read from a GML file named netscience.gml, can you read the list of communities from a JSON file named communities.json using the cdlib function read_community_json? After reading the communities from the JSON file, print the total number of nodes across all communities.
### Response:
import networkx as nx
from cdlib import readwrite

# Read the network science coauthorship graph
G = nx.read_gml('netscience.gml')

# Read community list from JSON file
communities = readwrite.read_community_json('communities.json')

# Now you have the communities loaded from the file and you can work with them
debug_size = sum(len(c) for c in communities.communities)
print(f'Total number of nodes in all communities: {debug_size}')
<|EOT|>
