Олимпиадный тренинг

Задача 45212. Turtle-1-6


Задача

Темы: ЕГЭ
The performer Turtle acts on a plane with a Cartesian coordinate system. At the initial moment, the Turtle is at the origin of coordinates, its head is directed along the positive direction of the y-axis, the tail is lowered. With the tail lowered, the Turtle leaves a trail in the form of a line on the field. At each specific moment, the position of the performer and the direction of his movement are known.
The performer has commands: Forward n and Back n (where n – is an integer), causing the Turtle to move by n units in the appropriate direction,  Right m and Left m (where m – is an integer) causing the direction to change to m degrees clockwise  or counterclockwise respectively.

Recording
Repeat k [Command1 Command2 … CommandS]
means that the sequence of S commands will be repeated k times.

Determine the number of segments that make up the figure given by the following algorithm:
Repeat 33 [Forward 8 Right 24]