import re


def clean_numbers(line):
	""" Clean up the successors of zero so basicly we parse a line from the 
	output and reamoves the "s (s (s (z))))" to a simple 4.
	
	Parameters:
	line (String) - one line from the outputted ceptre lines in the terminal.

	Returns:
	new_line (String) - Cleaned string with ints instead of (s z).
	"""
	tmp_line = re.sub(r"\([sz].*?\)", lambda m: str(m.group().count("s")), line)
	new_line = tmp_line.replace(")","").replace("(","").replace(" z"," 0")
	return new_line