Find Poly
시간 제한1초메모리 제한1024 MB
무향 선분 집합이 주어질 때, 연결된 도형의 개수와 그중 각 점을 시작점을 제외하고 한 번씩만 지나는 오일러 회로를 이루는 도형의 개수를 센다.
문제
Consider a set of line segments in a 2D plane.
For any set of line segments , define as the set of all endpoints of the line segments in .
Two line segments are said to be connected if they share an endpoint.
Given a set of line segments , we say that a geometric figure ("figure" for short) is a set of one or more line segments, , for which
- for any two points and in , we can reach from by tracing along one or more connected line segments, and
- for every line segment in , all line segments of that are connected to are also in .
A polygon is a geometric figure for which it is possible to trace a path starting from some endpoint and ending at using every line segment in exactly once and visiting each point in other than , exactly once, visiting only at the beginning and end of the path.
See figure 1 which has 10 figures of which , , , and are polygons. The dots are the end points of the line segments.

Figure 1: 10 figures, 4 polygons
Note that is self-intersecting but that the intersection is not at the end points of the intersecting line segments. Similarly and as well as and intersect but are not connected.
Your task is to count the total number of figures and identify how many are polygons.
입력
The input is a series of lines terminated by end-of-file. Each line will have one or more line segments of the form:
(x1,y1),(x2,y2);
where (x1,y1) is one end point and (x2,y2) is the other end point. . All coordinates are integers.
The separator characters, "(),;", may be preceded or followed by white space. A line may be at most characters long.
There will be at most line segments. A given line segment will only appear once in the input and none will be of length .
Line segments are not directed so the order of the end points in the line segment is not significant. The order of the line segments in the input is also not significant.
출력
Print a single line containing two integers separated by a single space. The first number should be the total number of figures and the second should be the number of polygons found.
In the first example below, the points correspond to the picture in Figure 1.