import
java.util.*;
class
Triangle {
int
a, b, c;
public
Triangle(
int
a,
int
b,
int
c)
{
this
.a = a;
this
.b = b;
this
.c = c;
}
@Override
public
boolean
equals(Object obj)
{
if
(obj ==
this
)
return
true
;
if
(!(obj
instanceof
Triangle))
return
false
;
Triangle t = (Triangle)obj;
int
cnt =
0
;
if
((
this
.a == t.a) || (
this
.a == t.b)
|| (
this
.a == t.c)) {
cnt++;
}
if
((
this
.b == t.a) || (
this
.b == t.b)
|| (
this
.b == t.c)) {
cnt++;
}
if
((
this
.c == t.a) || (
this
.c == t.b)
|| (
this
.c == t.c)) {
cnt++;
}
if
(cnt ==
3
) {
return
false
;
}
return
true
;
}
}
public
class
Main {
public
static
int
countUniqueTriangles(Triangle[] arr)
{
int
n = arr.length;
int
uni =
0
;
for
(
int
i =
0
; i < n -
1
; i++) {
int
cnt =
0
;
for
(
int
j = i; j < n -
1
; j++) {
if
(arr[i].equals(arr[j +
1
]))
cnt++;
}
if
(cnt == n -
1
- i)
uni++;
}
return
uni +
1
;
}
public
static
void
main(String[] args)
{
Triangle[] arr = {
new
Triangle(
3
,
2
,
2
),
new
Triangle(
3
,
4
,
5
),
new
Triangle(
1
,
2
,
2
),
new
Triangle(
2
,
2
,
3
),
new
Triangle(
5
,
4
,
3
),
new
Triangle(
6
,
4
,
5
)
};
System.out.println(countUniqueTriangles(arr));
}
}