You can count the spaces out, or subtract and use absolute value.
You could use the distance formula, but it's a bit overkill in this situation. The distance formula is only ever needed whenever we don't have horizontal or vertical line segments.
Edit: The solution has been corrected to the correct value.