eolymp
bolt
Try our new interface for solving problems
Problems

Boundaries

Boundaries

\includegraphics{https://static.e-olymp.com/content/ee/ee06f01c643f9ef1442eed4bfdd87c49b0816f1e.jpg} Ancient state NoRome had boundary in the kind of convex polygon measured by fence. State NoRom constantly increased the own territory by winning their enemies and conquering the new lands. When the new boundary created the convex polygon, NoRomans destroyed the old fence and built a new one. Modern historians decided to research the history of the development of an ancient NoRome. But the only thing they possessed was the coordinates of the holes from the poles, which was placed earlier as the tops of the polygons. Yours program has to help historians to determine the number of build fences, using the coordinates of the pole holes, taking into consideration the fact that each new fence was not contiguous to the old one. \InputFile Input file input.txt consists of several tests. The first line of each test shows the number of holes. In each next lines of test there are the full coordinates \textbf{X} and \textbf{Y} of one hole separated by a comma. The values of coordinates do not exceed \textbf{1000}. Holes coordinates are written in a random order. Input file does not have to contain the empty lines. \OutputFile The program has to display in a separate line the number of built fences for each test, or \textbf{NO}, if at least one fence does not form the convex polygon. Output has to end with the empty line.
Time limit 1 second
Memory limit 64 MiB
Input example #1
10
7, 16
12, 10
1, 22
23, 22
3, 6
14, 1
17, 20
27, 24
3, 20
11, 5
Output example #1
3