##representation of grid graph in the form of dictionary of dictionary

def make_link(G,node1,node2):
	if node1 not in G:
		G[node1]={}
	G[node1][node2]=1
	
	if node2 not in G:
		G[node2]={}
	G[node2][node1]=1




Graph={}
side=16

for i in range(side):
	for j in range(side):
		if i<side-1:make_link(Graph,(i,j),(i+1,j))
		if j<side-1:make_link(Graph,(i,j),(i,j+1))


##how many nodes?

print len(Graph)

##How many edge


print sum([len(Graph[node]) for node in Graph.keys()])/2


