eolymp
bolt
Try our new interface for solving problems
Problems

Zones on a Plane

Zones on a Plane

\includegraphics{https://static.e-olymp.com/content/6d/6d8c71e87f9a3466ba88cfda34552312d7f672f7.jpg} Consider zones \textbf{z_i} on a plane which consist of triangles. Zone \textbf{z_1} consists of two right-angled isosceles triangles, forming a square. Zone \textbf{z_\{n+1\}} is produced from zone \textbf{z_n} in the following way. For each triangle from the previous zone, construct two isosceles right-angled triangles on each of its two legs as a hypotenuse. Then, remove every triangle that is a part of a zone with lower number. The remaining triangles constitute the zone \textbf{z_\{n+1\}}. Given an integer number \textbf{n}, find how many simple polygons constitute the zone \textbf{z_n}. \InputFile There is a single integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{2000}) on the first line of the input. \OutputFile Output a single number --- the number of simple polygons zone \textbf{z_n} consists of.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
Output example #1
1
Author Dmitry Gozman
Source Dmitry Gozman Contest 1, Petrozavodsk training camp, January 2007