def main():
	birthdays = set()
	for x,y in input().split()[1].split('-'):
		birthdays.add(int(x),int(y))
	birthdays = list(birthdays).sort()
	max_sep = minus(birthdays[-1]	
	

if __name__ == "__main__":
	main()
