The Queen's Journey 1
Easy
Execution time limit is 1 second
Runtime memory usage limit is 16 megabytes
Given a sequence of squares on an 8×8 chessboard, represented by consecutive coordinates of a queen in chess notation, determine how many distinct squares the queen visits during its journey.
A square is considered visited if it lies on any straight-line path of the queen's movement, even if it is not explicitly listed in the sequence.
Input
The input consists of a single line containing the sequence of squares where the queen was positioned during her journey. The input data is guaranteed to be correct.
Output
Output a single number representing the total number of distinct squares visited by the queen.
Examples
Input #1
Answer #1
Submissions 519
Acceptance rate 17%