def encode_label(label: str) -> int:
	"""
	Encodes a label into a number

	If there is no label, the number is 0.

	Othewise, the number is the index in the sequence:

	```
	A1, B1, C1, D1, E1, A2, B2, C2, ...
	```

	A, B, C, D, E are interpretted as A1, B1, C1, D1, E1, respectively.
	"""
	if not label:
		return 0
	# part after letter if it has a number, otherwise 1
	index = int(label[1:]) if len(label) > 1 else 1
	# A = 1, B = 2, ... E = 5
	offset = ord(label[0]) - ord("A") + 1
	# compute label number
	return (index - 1) * 5 + offset