Little Petya is preparing for the first contact with aliens. He knows that alien spaceships have shapes of non-degenerate triangles and there will be exactly 4 ships. Landing platform for a ship can be made of 3 special columns located at some points of a Cartesian plane such that these 3 points form a triangle equal to the ship with respect to rotations, translations (parallel shifts along some vector) and reflections (symmetries along the edges). The ships can overlap after the landing.

Each column can be used to land more than one ship, for example, if there are two equal ships, we don't need to build 6 columns to land both ships, 3 will be enough. Petya wants to know what minimum number of columns will be enough to land all ships.
Each of 4 lines will contain 6 integers *x*<sub class="lower-index">1</sub> *y*<sub class="lower-index">1</sub> *x*<sub class="lower-index">2</sub> *y*<sub class="lower-index">2</sub> *x*<sub class="lower-index">3</sub> *y*<sub class="lower-index">3</sub> (0 ≤ *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>, *x*<sub class="lower-index">3</sub>, *y*<sub class="lower-index">3</sub> ≤ 20), representing 3 points that describe the shape of each of 4 ships. It is guaranteed that 3 points in each line will represent a non-degenerate triangle.
In the first test case columns can be put in these points: (0, 0), (1, 0), (3, 0), (1, 2). Note that the second ship can land using last 3 columns.

In the second test case following points can be chosen: (0, 0), (0, 1), (1, 0), (0, 2), (2, 0), (0, 5), (5, 0), (0, 17), (17, 0). It is impossible to use less than 9 columns.
def non_repeat_points(trgl, coordinates, count_ship):
    vertices = set()
    for i in range (count_ship):
        for j in range(1, coordinates * 2, 2):
            vertices.add(str(trgl[i][j - 1]) + ' ' + str(trgl[i][j])) 
    vertices = list(vertices)   
    return vertices

def number_combinations(v, bounds):
    array = []
    for i in range(len(v)):
        v[i] = v[i].split()
    for i in range(0, bounds - 2): #сочетания
        for j in range (i + 1, bounds - 1):
            for k in range (j + 1, bounds): 
                l1 = ((int(v[i][0]) - int(v[j][0])) ** 2 + (int(v[i][1]) - int(v[j][1])) ** 2) ** 0.5
                l2 = ((int(v[i][0]) - int(v[k][0])) ** 2 + (int(v[i][1]) - int(v[k][1])) ** 2) ** 0.5
                l3 = ((int(v[j][0]) - int(v[k][0])) ** 2 + (int(v[j][1]) - int(v[k][1])) ** 2) ** 0.5
                if l1 < l2 + l3 and l2 < l1 + l3 and l3 < l1 + l2:
                    tmp = sorted([l1, l2, l3])
                    tmp.append(str(i + 1) + str(j + 1) + str(k + 1))
                    array.append(tmp)
    return array

def initial_len_trgl(trgl, count_ship):
    len_trgl = set()
    for i in range(count_ship):
        l1 = ((trgl[i][2] - trgl[i][0]) ** 2 + (trgl[i][3] - trgl[i][1]) ** 2) ** 0.5
        l2 = ((trgl[i][4] - trgl[i][0]) ** 2 + (trgl[i][5] - trgl[i][1]) ** 2) ** 0.5
        l3 = ((trgl[i][4] - trgl[i][2]) ** 2 + (trgl[i][5] - trgl[i][3]) ** 2) ** 0.5
        array = sorted([l1, l2, l3])
        s = str(array[0]) + ' ' + str(array[1]) + ' ' + str(array[2])
        len_trgl.add(s)
        
    len_trgl = list(len_trgl)
    for i in range (len(len_trgl)):
        len_trgl[i] = len_trgl[i].split()
    return len_trgl

def possible_set_points(len_trgl, trgl_set, count_ship):
    points = [[] for i in range (count_ship)]
    for i in range (len(len_trgl)):
        for j in range (len(trgl_set)):
            if (float(len_trgl[i][0]) == trgl_set[j][0] and 
                float(len_trgl[i][1]) == trgl_set[j][1] and 
                float(len_trgl[i][2]) == trgl_set[j][2]):
                points[i].append(trgl_set[j][3])
    return points

count_ship = 4
trgl = [list(map(int, input().split())) for i in range (count_ship)]
vertices = non_repeat_points(trgl, 3, 4) #неповторяющиеся вершины
trgl_set = number_combinations(vertices, len(vertices)) #всевозможные треугольники из найденных точек плоскости
len_trgl = initial_len_trgl(trgl, 4) #длины сторон исходных треугольников
p = possible_set_points(len_trgl, trgl_set, 4) #множество вершин для исходных треугольников

for i in range (len(p)):
    if len(p[i]) == 0:
        p[i].append('')
min_count = 10 ** 100

for i1 in range(len(p[0])):
    for i2 in range(len(p[1])):
        for i3 in range(len(p[2])):
            for i4 in range(len(p[3])):
                s = p[0][i1] + p[1][i2] + p[2][i3] + p[3][i4]
                if min_count > len(set(s)):
                    min_count = len(set(s))
print(min_count)