This problem is same as the next one, but has smaller constraints.

It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the power station, the cats got impressed with a large power transmission system consisting of many chimneys, electric poles, and wires. Since they are cats, they found those things gigantic.

At the entrance of the station, there is a map describing the complicated wiring system. Selena is the best at math among three friends. He decided to draw the map on the Cartesian plane. Each pole is now a point at some coordinates $(x_i, y_i)$. Since every pole is different, all of the points representing these poles are distinct. Also, every two poles are connected with each other by wires. A wire is a straight line on the plane infinite in both directions. If there are more than two poles lying on the same line, they are connected by a single common wire.

Selena thinks, that whenever two different electric wires intersect, they may interfere with each other and cause damage. So he wonders, how many pairs are intersecting? Could you help him with this problem?


-----Input-----

The first line contains a single integer $n$ ($2 \le n \le 50$) — the number of electric poles.

Each of the following $n$ lines contains two integers $x_i$, $y_i$ ($-10^4 \le x_i, y_i \le 10^4$) — the coordinates of the poles.

It is guaranteed that all of these $n$ points are distinct.


-----Output-----

Print a single integer — the number of pairs of wires that are intersecting.


-----Examples-----
Input
4
0 0
1 1
0 3
1 2

Output
14

Input
4
0 0
0 2
0 4
2 0

Output
6

Input
3
-1 -1
1 0
3 1

Output
0



-----Note-----

In the first example: [Image] 

In the second example: [Image] 

Note that the three poles $(0, 0)$, $(0, 2)$ and $(0, 4)$ are connected by a single wire.

In the third example: [Image]

Difficulty: interview

Starter code:

Solutions:
n = int(input())
T = []
for i in range(n):
    x, y = map(int, input().split())
    T.append([x, y])
P = []
for i in range(n):
    for j in range(i + 1, n):
        x1, y1 = T[i]
        x2, y2 = T[j]
        a = y2 - y1
        b = x1 - x2
        c = -(a * x1 + b * y1)
        P.append([a, b, c])
const = 10 ** 10 + 3
cnt = 0
newP = []
visit = []
for a, b, c in P:
    if a != 0:
        if [1, b / a, c / a] not in visit:
            newP.append([1, b / a, c / a])
            visit.append([1, b / a, c / a])
    else:
        if [0, 1, c / b] not in visit:
            newP.append([0, 1, c / b])
            visit.append([0, 1, c / b])
P = newP
for i in range(len(P)):
    for j in range(i + 1, len(P)):
        a1, b1, c1 = P[i]
        a2, b2, c2 = P[j]
        if a1 * b2 == a2 * b1:
            pass
        else:
            x = (b1 * c2 - b2 * c1) / (a1 * b2 - b1 * a2)
            y = (c1 * a2 - a1 * c2) / (a1 * b2 - b1 * a2)
            cnt += 1
print(cnt)

#Bhargey Mehta (Sophomore)
#DA-IICT, Gandhinagar
import sys, math, queue
#sys.stdin = open("input.txt", "r")
MOD = 10**9+7

n = int(input())
p = []
for i in range(n):
    x, y = map(int, input().split())
    p.append((x, y))

d = {}

for i in range(n):
    x1, y1 = p[i]
    for j in range(i+1, n):
        x2, y2 = p[j]
        if x1 != x2:  
            m = (y2-y1)/(x2-x1)
            c = (y1*x2-x1*y2)/(x2-x1)
        else:
            m = 10**10
            c = x1
        if m in d:
            if c in d[m]:
                d[m][c] += 1
            else:
                d[m][c] = 1
        else:
            d[m] = {c: 1}

p = []
for m in d:
    p.append(len(d[m]))
s = sum(p)
ans = 0
for x in p:
    ans += x*(s-x)
print(ans//2)

import math


class Pt:

    def __init__(self, *args):
        if len(args) == 0:
            self.x, self.y = 0, 0
        elif len(args) == 1:
            self.x, self.y = list(map(int, args[0].split()))
        else:
            self.x, self.y = args[0], args[1]

    def __str__(self):
        return str(self.x) + ' ' + str(self.y)

    def __add__(self, other):
        return Pt(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Pt(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return Pt(self.x * other, self.y * other)

    def __rmul__(self, other):
        return self * other

    def __truediv__(self, other):
        return Pt(self.x / other, self.y / other)

    def __abs__(self):
        return math.hypot(self.x, self.y)

    def __eq__(self, other):
        return self.x == other.x and self.y == other.y

    def dot(self, other):
        return self.x * other.x + self.y * other.y

    def cross(self, other):
        return self.x * other.y - self.y * other.x

    @staticmethod
    def get_straight(self, other):
        a = self.y - other.y
        b = other.x - self.x
        c = self.cross(other)
        return a, b, c


class Straight:

    def __init__(self, *args):
        if len(args) == 1:
            self.a, self.b, self.c = list(map(int, args[0].split()))
        elif len(args) == 2:
            self.a, self.b, self.c = Pt.get_straight(*args)
        elif len(args) == 3:
            self.a, self.b, self.c = args

    def __str__(self):
        return ' '.join(map(str, [self.a, self.b, self.c]))

    def __eq__(self, other):
        if self.b != 0 or other.b != 0:
            return self.a * other.b == other.a * self.b and self.c * other.b == other.c * self.b
        val1 = math.sqrt(self.a ** 2 + self.b ** 2)
        val2 = math.sqrt(other.a ** 2 + other.b ** 2)
        a1, c1 = self.a / val1, self.c / val1
        a2, c2 = other.a / val2, other.c / val2
        if (a1 < 0) != (a2 < 0):
            a1, a2, c1, c2 = a1, -a2, c1, -c2
        return a1 == a2 and c1 == c2

    def perpendicular(self, point: Pt):
        return Straight(-self.b, self.a, self.b * point.x - self.a * point.y)

    def get_value(self, point):
        return self.a * point.x + self.b * point.y + self.c

    def is_own(self, point: Pt):
        return self.get_value(point) == 0

    def same_side(self, pt1, pt2):
        return (self.get_value(pt1) < 0) == (self.get_value(pt2) < 0)

    def intersection(self, other):
        d = Pt(self.a, self.b).cross(Pt(other.a, other.b))
        dx = Pt(self.c, self.b).cross(Pt(other.c, other.b))
        dy = Pt(self.a, self.c).cross(Pt(other.a, other.c))
        return Pt(-dx / d, -dy / d)

    def dist_from_point(self, point):
        val = math.sqrt(self.a ** 2 + self.b ** 2)
        return abs(Straight(self.a / val, self.b / val, self.c / val).get_value(point))

    def parallel(self, dist):
        val = math.sqrt(self.a ** 2 + self.b ** 2)
        return Straight(self.a, self.b, self.c - dist * val)

    def is_parallel(self, other):
        return self.a * other.b == self.b * other.a

    def is_perpendicular(self, other):
        per = Straight(-self.b, self.a, 0)
        return per.a * other.b == per.b * other.a


n = int(input())
points = [Pt(input()) for _ in range(n)]
straights = []
for i in range(n):
    for j in range(i + 1, n):
        st = Straight(points[i], points[j])
        ok = True
        for x in straights:
            if st == x:
                ok = False
                break
        if ok:
            straights.append(st)
res = 0
m = len(straights)
for i in range(m):
    for j in range(i + 1, m):
        if not straights[i].is_parallel(straights[j]):
            res += 1
print(res)


import sys
input = sys.stdin.readline

n=int(input())
W=[list(map(int,input().split())) for i in range(n)]

SET=set()

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def point(a,b,c,d):
    g=gcd(c-a,d-b)
    K=[(c-a)//g,(d-b)//g]

    if K==[0,1]:
        SET.add(tuple(K+[a]))

    else:
        SET.add(tuple(K+[((d-b)*(-a)+(c-a)*b)/(c-a)]))    

for i in range(n-1):
    a,b=W[i]
    for j in range(i+1,n):
        if i==j:
            continue
        c,d=W[j]

        point(a,b,c,d)

#print(SET)
LIST=list(SET)
ANS=0
for i in range(len(LIST)-1):
    NOW0,NOW1=LIST[i][0],LIST[i][1]
    for j in range(i+1,len(LIST)):
        if NOW0!=LIST[j][0] or NOW1!=LIST[j][1]:
            ANS+=1

print(ANS)

        
        
    


import itertools
import math
from functools import reduce
from math import gcd

# 2d line: ax + by + c = 0  is  (a, b, c)

#          ax + by + c = 0     ((a, b, c),
# 3d line: dx + ez + f = 0  is  (d, e, f),
#          gy + hz + i = 0      (g, h, i))

gcdm = lambda *args: reduce(gcd, args, 0)


def pointsToLine2d(p1, p2):
    if p1 == p2:
        return (0, 0, 0)
    _p1, _p2 = sorted((p1, p2))

    g = gcdm(*[x for x in (_p2[1] - _p1[1], _p1[0] - _p2[0], _p1[1] * _p2[0] - _p1[0] * _p2[1]) if x != 0])

    return ((_p2[1] - _p1[1]) // g, (_p1[0] - _p2[0]) // g, (_p1[1] * _p2[0] - _p1[0] * _p2[1]) // g)


dist = lambda p1, p2: sum((a - b) * (a - b) for a, b in zip(p1, p2))**0.5

pointsToLines = lambda p1, p2: list(map(pointsToLine2d, itertools.combinations(p1, 2), itertools.combinations(p2, 2)))

areParallel = lambda l1, l2: l1[0] * l2[1] == l2[0] * l1[1]

areSame = lambda l1, l2: areParallel(l1, l2) and (l1[1] * l2[2] == l2[1] * l1[2])

collinear = lambda p1, p2, p3: areSame(pointsToLine2d(p1, p2), pointsToLine2d(p2, p3))

intersect = lambda l1, l2: None if areParallel(l1, l2) else ((l2[1] * l1[2] - l1[1] * l2[2]) / (l2[0] * l1[1] - l1[
    0] * l2[1]), (l1[0] * l2[2] - l1[2] * l2[0]) / (l2[0] * l1[1] - l1[0] * l2[1]))

rotate = lambda p, theta, origin=(0, 0): (origin[0] + (p[0] - origin[0]) * math.cos(theta) - (p[1] - origin[
    1]) * math.sin(theta), origin[1] + (p[0] - origin[0]) * math.sin(theta) + (p[1] - origin[1]) * math.cos(theta))


def main():
    from sys import stdin, stdout

    def read():
        return stdin.readline().rstrip('\n')

    def read_array(sep=None, maxsplit=-1):
        return read().split(sep, maxsplit)

    def read_int():
        return int(read())

    def read_int_array(sep=None, maxsplit=-1):
        return [int(a) for a in read_array(sep, maxsplit)]

    def write(*args, **kwargs):
        sep = kwargs.get('sep', ' ')
        end = kwargs.get('end', '\n')
        stdout.write(sep.join(str(a) for a in args) + end)

    def write_array(array, **kwargs):
        sep = kwargs.get('sep', ' ')
        end = kwargs.get('end', '\n')
        stdout.write(sep.join(str(a) for a in array) + end)

    n = read_int()
    p = []
    for _ in range(n):
        p.append(read_int_array())

    lines = set()
    for i in range(n):
        for j in range(i+1, n):
            lines.add(pointsToLine2d(p[i], p[j]))

    k = len(lines)
    import collections
    ax_bx = collections.defaultdict(int)
    out = 0
    for a, b, _ in lines:
        ax_bx[a, b] += 1
    for x in list(ax_bx.values()):
        out += (k - x) * x
    write(out // 2)

main()


from fractions import Fraction
n=int(input())
l1=[]
d2={}
for i in range(0,n):
    x,y=map(int,input().split())
    for item in l1:
        if x==item[0]:
            if 'inf' not in d2:
                d2['inf']=[x]
            
            elif x not in d2['inf']:
                d2['inf'].append(x)
        else :
            slope=Fraction((y-item[1]),(x-item[0]))
            c=Fraction(y,1)-slope*Fraction(x,1)
            if slope not in d2:
                d2[slope]=[c]
            elif c not in d2[slope]:
                d2[slope].append(c)
    l1.append((x,y))
z=0
ans=0
f=0
for k in d2:
    z+=len(d2[k])
for k in d2:
    x=len(d2[k])
    f=f+x
    ans+=x*(z-f)
print(ans)

from collections import defaultdict as dd
from itertools import combinations
import math
import heapq
def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return list(map(int, input().split()))

def lm():
	return list(map(int, input().split()))



n=nn()

points=[]

for i in range(n):
	points.append(lm())



slopedict=dd(set)
lines=0

for p1, p2 in combinations(points,2):
	x1,y1=p1
	x2,y2=p2


	g=math.gcd(y2-y1,x2-x1)
	if y2-y1<0:
		sign=-1

	elif y2-y1==0:
		if x2-x1<0:
			sign=-1
		else:

			sign=1

	else:
		sign=1
	slope=(sign*(y2-y1)//g,sign*(x2-x1)//g) 
	

	if not slope[1]==0:
		ceptn=slope[1]*y1-slope[0]*x1
		ceptd=slope[1]

		if ceptn<0:
			sign=-1
		
		elif ceptn==0:
			if ceptd<0:
				sign=-1
			else:

				sign=1

		else:
			sign=1
		
		g=math.gcd(ceptn,ceptd)
		cept=(sign*ceptn/g,sign*ceptd/g)
	else:
		cept=x1



	if not cept in slopedict[slope]:
		slopedict[slope].add(cept)
		lines+=1

total=0


for slope in slopedict:

	total=total+(lines-len(slopedict[slope]))*len(slopedict[slope])


print(total//2)	

pos=math.gcd(-4,2)
neg=math.gcd(4,-2)
#print(pos,neg)

#print(-4//pos,2//pos)

#print(4//neg,-2//neg)
	



from collections import defaultdict
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int,input().split())))

d = defaultdict(int)
dh = defaultdict(list)
dhs = []
s = 0
for i in range(n):
    for j in range(i+1,n):
        try:
            t = (a[j][1]-a[i][1])/(a[j][0]-a[i][0])
            if d[t]==0:
                d[t] = 1
                dh[t].append(i)
                dh[t].append(j)
            else:
                if i not in dh[t] and j not in dh[t]:
                    d[t]+=1
                dh[t].append(i)
                dh[t].append(j)
        except:
            if s==0:
                s+=1
            elif i not in dhs and j not in dhs:
                s+=1
            dhs.append(i)
            dhs.append(j)

t = list(d.keys())
c = 0
l = 0
for i in t:
    k = d[i]
    l+=k
    c+=((k)*(k-1))//2

c+=((s)*(s-1))//2
l += s
l = (l*(l-1))//2
print(l-c)


def get_k(a, b):
    x1, y1 = a
    x2, y2 = b
    if x2 != x1:
        return (y2 - y1) / (x2 - x1)
    return 10**10


def get_offset(a, k2):
    x, y = a
    return y - k2 * x


cnt = 0
a = []
n = int(input())
for i in range(n):
    a.append(tuple(map(int, input().split())))
alines = []
for i in range(n):
    for j in range(n):
        if i >= j: continue
        alines.append((a[i], a[j]))

lines = []
s = set()
for i, l1 in enumerate(alines):
    for j in range(i + 1, len(alines)):
        l2 = alines[j]
        k1, k2 = get_k(*l1), get_k(*l2)
        o1, o2 = get_offset(l1[0], k1), get_offset(l2[0], k2)
        if (k1 == k2 == 10**10 and l1[0][0] == l2[0][0]):
            o1 = o2 = 0
        if (abs(k1 - k2) < 1e-10 and abs(o1 - o2) < 1e-10) or (k1 == k2 == 10**10 and l1[0] == l2[0]):
            s.add(j)
    if i not in s:
        lines.append(l1)

for i, l1 in enumerate(lines):
    for j, l2 in enumerate(lines):
        if i >= j:
            continue
        if abs(get_k(*l1) - get_k(*l2)) > 1e-10:
            cnt += 1
print(cnt)


from math import *

class slopeC:
    def __init__(self):        
        self.chil = set()
n = int(input())

slopes = {}
L = []
for i in range(n):
    x, y = list(map(int, input().split()))
    
    for l in L:
        if x != l[0]:
            slope = (y - l[1]) / (x - l[0])
        else:
            slope = inf
            
        s1 = str(l[0]) + '-' + str(l[1])
        s2 = str(x) + '-' + str(y)
        if slope not in slopes:
            slopes[slope] = [slopeC()]
            slopes[slope][0].chil.add(s1)
            slopes[slope][0].chil.add(s2)
        else:
            f = 0
            for child in slopes[slope]:
                if s1 in child.chil:
                    f = 1
                    child.chil.add(s2)
                    break
            if f == 0:
                slopes[slope] += [slopeC()]
                slopes[slope][0].chil.add(s1)
                slopes[slope][0].chil.add(s2)
        
    L += [[x, y]]
A = []
P = [0]
for s in slopes:
    A += [(len(slopes[s]))]
    P += [P[-1] + A[-1]]
    
ans = 0


for i, v in enumerate(A):
    ans += A[i] * (P[-1] - P[i+1])
print(ans)


    


from math import gcd

n = int(input())
P = [[int(x) for x in input().split()] for _ in range(n)]

L = []
def addLine(x,y,dx,dy):
    if dx < 0:
        dx *= -1
        dy *= -1
    elif dx == 0:
        if dy < 0:
            dy *= -1
    g = gcd(dx,dy)
    dx //= g
    dy //= g

    x += dx * (10**9)
    y += dy * (10**9)
    if dx:
        k = x//dx
    else:
        k = y//dy
    x -= k*dx
    y -= k*dy
    L.append((x,y,dx,dy))


for i in range(n):
    for j in range(i+1,n):
        xi,yi = P[i]
        xj,yj = P[j]
        dx,dy = xi-xj,yi-yj
        addLine(xi,yi,dx,dy)

L = list(set(L))
res = 0
for i in range(len(L)):
    for j in range(i+1, len(L)):
        x1,y1,dx1,dy1 = L[i]
        x2,y2,dx2,dy2 = L[j]
        if dx1 != dx2 or dy1 != dy2:
            #print(L[i])
            #print(L[j])
            #print('---')
            res += 1

print(res)








from collections import Counter
N = int(input())
if N == 2:
    print(0)
    return
inf = 10**9+7
inf2 = 10**18
def gcdl(A):
    if len(A) == 0:
        return -1
    if len(A) == 1:
        return 0
    g = gcd(A[0], A[1])
    for a in A[2:]:
        g = gcd(a, g)
    return g
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
Point = []
ans = 0
for _ in range(N):
    Point.append(list(map(int, input().split())))
S = Counter()
T = set()
for i in range(N):
    x1 , y1 = Point[i]
    for j in range(N):
        if i == j:
            continue
        x2 , y2 = Point[j]
        a = y1 - y2
        b = -(x1 - x2)
        c = x2*y1 - x1*y2
        g = gcdl([a, b, c])
        a //= g
        b //= g
        c //= g
        if a < 0:
            a *= -1
            b *= -1
            c *= -1
        k = a*inf+b*inf2+c
        if k not in T:
            T.add(a*inf+b*inf2+c)
            if x1 == x2:
                S[-1] += 1
            else:
                y = y1 - y2
                x = x1 - x2
                g = gcd(y, x)
                y //= g
                x //= g
                if y < 0:
                    y *= -1
                    x *= -1
                S[y*inf+x] += 1
L = len(T)
ans = L*(L-1)//2
for s in S.values():
    ans -= s*(s-1)//2
print(ans)

from fractions import Fraction
from math import inf

n = int(input())
coords = []
for i in range(n):
    x, y = [int(c) for c in input().split(" ")]
    coords.append((x, y))

tangents = {}
for i1 in range(n):
    for i2 in range(i1+1, n):
        x1, y1 = coords[i1]
        x2, y2 = coords[i2]
        if x2 == x1:
            tangent = inf
            offset = x1
        else:
            tangent = Fraction(y2-y1, x2-x1)
            offset = - tangent * x1 + y1

        if tangent not in tangents: tangents[tangent] = set()
        tangents[tangent].add(offset)

tangentlen = {}
for tangent in tangents: tangentlen[tangent] = len(tangents[tangent])

summ = 0
for tangent in tangents: summ += tangentlen[tangent]

answer = 0
for t1 in tangents:
    answer += tangentlen[t1] * (summ - tangentlen[t1])
print(answer // 2)


n = int(input())
l = set()
s = [list(map(int, input().split())) for _ in range(n)]
for i in range(n):
        for j in range(i+1, n):
                x1, y1 = s[i]
                x2, y2 = s[j]
                if x1==x2: 
                        l.add((float('INF'), x1))
                else:
                        a = (y1-y2)/(x1-x2)
                        b = (x1*y2-x2*y1)/(x1-x2)
                        l.add((a, b))
lis = [i[0] for i in l]
from collections import Counter
dic = Counter(lis)
r = len(l)**2 - len(l)
for i in dic:
        r -= dic[i]**2-dic[i]
print(r//2)


from random import random
from collections import defaultdict
from fractions import Fraction
import math
import re
import fractions

N = int(input())
lines = defaultdict(set)
poles = []
for _ in range(N):
    x, y = list(map(int, input().split(" ")))
    for xx, yy in poles:
      if yy - y == 0:
        slope = Fraction(10**6, 1)
        const = y
      else:
        slope = Fraction(xx - x, yy - y)
        const = x - (slope * y)
      lines[slope].add(const)
    poles.append((x, y))

result = 0
visited = 0
# print(lines)
for slope in lines:
  result += visited * len(lines[slope])
  visited += len(lines[slope])
print(result)
    


n = int(input())
ls = set()
pts = []
for i in range(n):
    x, y = list(map(int, input().split()))
    pts.append([x, y])
for i in range(n):
    for j in range(i + 1, n):
        x1 = pts[i][0]
        y1 = pts[i][1]
        x2 = pts[j][0]
        y2 = pts[j][1]
        m = (y2 - y1) / (x2 - x1) if x2 != x1 else 'I'
        c = (x2 * y1 - x1 * y2) / (x2 - x1) if x1 != x2 else x1
        ls.add((m, c))
ins = set()
ls = list(ls)
nls = len(ls)
for i in range(nls):
    for j in range(i + 1, nls):
        m1 = ls[i][0]
        m2 = ls[j][0]
        if m1 != m2:
            x = [i, j]
            x.sort()
            ins.add(tuple(x))
print(len(ins))



def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


n = int(input())
p = [0] * n
for i in range(n):
    p[i] = [int(item) for item in input().split()]

wires = set()


for i in range(n):
    for j in range(i + 1, n):
        x0, y0 = p[i]
        x1, y1 = p[j]
        a = -(y1 - y0)
        b = (x1 - x0)
        c = x0 * (y1 - y0) - y0 * (x1 - x0)
        k = gcd(a, gcd(b, c))
        a //= k
        b //= k
        c //= k
        if a < 0:
            a *= -1
            b *= -1
            c *= -1
        wires.add((a, b, c))

wires = list(wires)

ans = 0
# print(wires)
for i in range(len(wires)):
    for j in range(i + 1, len(wires)):
        a1, b1, c1 = wires[i]
        a2, b2, c2 = wires[j]
        if b1 == 0:
            if b2 != 0:
                ans += 1
        elif b2 == 0:
            ans += 1
        else:
            if abs(a1 / b1 - a2 / b2) > 1e-7:
                ans += 1

print(ans)


n = int(input())


def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x


poles = []
for i in range(n):
    x, y = list(map(int, input().split()))
    poles.append((x, y))

lines = set()
for i in range(len(poles) - 1):
    for j in range(i + 1, len(poles)):
        p1 = poles[i]
        p2 = poles[j]
        a = p1[1] - p2[1]
        b = - p1[0] + p2[0]
        abg = gcd(abs(a), abs(b))
        if abg > 0:
            a //= abg
            b //= abg
        if a < 0:
            a = -a
            b = -b
        if a == 0:
            b = 1
        if b == 0:
            a = 1
        c = - a * p1[0] - b * p1[1]
        lines.add((a, b, c))
        # print(a, b, c)

        # lines.append((p1, p2))

# points = set()
cnt = 0
for i, line1 in enumerate(lines):
    for j, line2 in enumerate(lines):
        if i >= j:
            continue
        # print(i, j)

        if line1[:2] != line2[:2]:
            cnt += 1

        # ap1 = line1[0]
        # ap2 = line1[1]
        # bp1 = line2[0]
        # bp2 = line2[1]
        #
        # under = (bp2[1] - bp1[1]) * (ap2[0] - ap1[0]) - (bp2[0] - bp1[0]) * (ap2[1] - ap1[1])
        # if under == 0:
        #     continue
        #
        # t = (bp2[0] - bp1[0]) * (ap1[1] - bp1[1]) - (bp2[1] - bp1[1]) * (ap1[0] - bp1[0])
        # s = (ap2[0] - ap1[0]) * (ap1[1] - bp1[1]) - (ap2[1] - ap1[1]) * (ap1[0] - bp1[0])
        #
        # if t < 0 or t > under or s < 0 or s > under:
        #     continue
        #
        # if t == 0 and s == 0:
        #     continue
        #
        # print('add')
        # cnt += 1

        # x = [ap1[0] * under + t * (ap2[0] - ap1[0]), under]
        # y = [ap1[1] * under + t * (ap2[1] - ap1[1]), under]
        # xg = gcd(x[0], x[1])
        # if xg > 0:
        #     x[0] //= xg
        #     x[1] //= xg
        # yg = gcd(y[0], y[1])
        # if yg > 0:
        #     y[0] //= yg
        #     y[1] //= yg
        # if under < 0:
        #     x[0] = -x[0]
        #     x[1] = -x[1]
        #     y[0] = -y[0]
        #     y[1] = -y[1]
        #
        # x = tuple(x)
        # y = tuple(y)
        # p = (x, y)
        #
        #
        #

print(cnt)


#!/usr/local/bin/python3.5 -tt

import random
import sys

from fractions import Fraction, gcd

INF = 10 ** 9

def __starting_point():
    def _(f):
        for l in f:
            for i in l.split():
                yield int(i)

    g = _(sys.stdin)

    n = next(g)

    pts = []

    for i in range(n):
        x, y = (next(g),
                next(g),
                )

        pts.append((x, y))

    lines = set()
        
    for i in range(n):
        for j in range(i + 1, n):
            x0, y0, x1, y1 = (pts[i][0],
                              pts[i][1],
                              pts[j][0],
                              pts[j][1],
                              )
                              
            dx, dy = (x1 - x0,
                      y1 - y0,
                      )

            g = gcd(dx, dy)

            dx //= g
            dy //= g

            if dx:
                a = Fraction(dy, dx)

                b = - Fraction(dy * x0, dx) + y0
            else:
                a, b = (INF,
                        x0,
                        )

            lines.add((a, b))

    a = list(lines)

    size = len(lines)
    
    c = 0

    for i in range(size):
        for j in range(i + 1, size):
            if a[i][0] == a[j][0]:
                continue

            c += 1

    print(c)

__starting_point()

n=int(input().strip())
num=[]
for k in range(n):
    num.append(list(map(int,input().strip().split())))
d={}
import math
for k in range(n):
    for kk in range(k+1,n):
        a=num[k]
        b=num[kk]
        if(a[0]==b[0]):
            if((100000,100000) in d.keys()):
                d[(100000,100000)].add(a[0])
            else:
                d[(100000, 100000)]={a[0]}
        elif(a[1]==b[1]):
            if(0,1) in d.keys():
                d[(0,1)].add(a[1])
            else:
                d[(0,1)]={a[1]}
        else:
            c=b[1]-a[1]
            dd=b[0]-a[0]
            q=math.gcd(c,dd)
            c1=c//q
            d1=dd//q
            r=(a[0]*b[1])-(a[1]*b[0])
            if(r!=0):
                rr=math.gcd(r,dd)
                r=r//rr
                d2=dd//rr
                if(d2<0):
                    d2=-d2
                    r=-r
                if(d1<0):
                    d1=-d1
                    c1=-c1
                if((c1,d1) in d.keys() ):
                    d[(c1,d1)].add((r,d2))
                else:
                    d[(c1,d1)]={(r,d2)}
            else:
                if (d1 < 0):
                    d1 = -d1
                    c1 = -c1
                if ((c1, d1) in d.keys()):
                    d[(c1, d1)].add((0,1))
                else:
                    d[(c1, d1)] = {(0,1)}
s=0
for i in d.keys():
    s=s+(len(d[i]))
ss=0
for i in d.keys():
    s=s-(len(d[i]))
    ss=ss+(s*len(d[i]))
print(ss)

from fractions import Fraction
from collections import Counter
n = int(input())

p = []

lines = set()
c= Counter()
for _ in range(n):
    x, y = list(map(int, input().split()))
    p.append((x, y))


for i in range(n-1):
    for j in range(i+1, n):
        try:
            l = (
                    Fraction(p[i][1]-p[j][1], p[i][0] - p[j][0]),
                    Fraction(p[j][1]*p[i][0] - p[i][1]*p[j][0], p[i][0]-p[j][0])
                )
        except ZeroDivisionError:
            l = ('i', p[i][0])
        if l not in lines:
            lines.add(l)
            c[l[0]] += 1

#print(lines)
#print(c)
#print(len(lines))

t = 0

tt = len(lines)
for l in lines:
    t += tt - c[l[0]]



print(t // 2)


n=int(input())
coords=[]
for i in range(n):
    coords.append(tuple(map(int,input().split())))
slopes={}
for i in range(n):
    for j in range(i+1,n):
        x1,y1=coords[i][0],coords[i][1]
        x2,y2=coords[j][0],coords[j][1]
        if x1==x2:
            slope="inf"
            mark=x1
        else:
            slope=round((y2-y1)/(x2-x1),12)
            mark=round(y1-x1*slope,7)
        if slope in slopes:
            slopes[slope].add(mark)
        else:
            slopes[slope]={mark}
tot=sum(len(slopes[guy]) for guy in slopes)
sumi=0
for guy in slopes:
    a=len(slopes[guy])
    sumi+=a*(tot-a)
print(sumi//2)

n = int(input())

x = []
y = []

lineas = set()
lineas1 = set()
lineas2 = set()

caca = dict()

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a%b)

for i in range(n):
	a, b = map(int, input().split())
	x.append(a)
	y.append(b)
	for j in range(i):
		a1 = a-x[j]
		b1 = b-y[j]

		p1 = max(abs(a1), abs(b1))
		p2 = min(abs(a1), abs(b1))
		g = gcd(p1, p2)
		a1 = int(a1/g)
		b1 = int(b1/g)
		if a1 < 0:
			a1 *= -1
			b1 *= -1

		aux = (b*a1)-(a*b1)

		if a1 == 0:
			lineas1.add(a)
		elif b1 == 0:
			lineas2.add(b)
		else:
			if (a1, b1) in caca:
				caca[(a1, b1)].add(aux)
			else:
				caca[(a1, b1)] = set()
				caca[(a1, b1)].add(aux)
			lineas.add((a1, b1, aux))

sol = 0
aux = len(lineas)
sol += int(aux*(aux-1)/2)
sol += aux*(len(lineas1)+len(lineas2))
sol += len(lineas1)*len(lineas2)
for a in caca.keys():
	aux = len(caca[a])
	#print(a, caca[a], aux)
	sol -= int(aux*(aux-1)/2)
print(sol)

"""
NTC here
"""
from sys import setcheckinterval,stdin,setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10**6)

#print("Case #{}: {} {}".format(i, n + m, n * m))

iin=lambda :int(stdin.readline())
lin=lambda :list(map(int,stdin.readline().split()))


from fractions import gcd
n=iin()
points=[lin() for i in range(n)]
ans=set()
for i in range(n):
    x1,y1=points[i]
    for j in range(i+1,n):
        x2,y2=points[j]
        a,b,c=y1-y2,x2-x1,y1*(x1-x2)-x1*(y1-y2)
        g=gcd(gcd(a,b),c) if c else gcd(a,b)

        ans.add((a//g,b//g,c//g))
intersections=set()
la=list(ans)
l=len(la)
for i in range(l):
    a,b,c=la[i]
    for j in range(i+1,l):
        try:
            e,d,f=la[j]
            y=(a*f-c*e)/(b*e-a*d)
            x=(c*d-b*f)/(b*e-a*d)
            intersections.add((i,j))
        except:
            pass
#print(intersections,ans,sep='\n')
print(len(intersections))


# stdin=open('input.txt')

# def input():
# 	return stdin.readline()[:-1]

'''
stdout=open('output.txt',mode='w+')
def print(x,end='\n'):
	stdout.write(str(x)+end)
'''
#map(int, input().split())

# CODE BEGINS HERE.................



import math
n = int(input())

points = []
lines = set([])

for i in range(n):
	x, y = list(map(int, input().split()))
	points.append((x, y))

for i in range(n):
	for j in range(i):
		if points[i][0] - points[j][0] == 0:
			lines.add((math.inf, points[i][0]))
		else:
			m = (points[i][1] - points[j][1])/(points[i][0] - points[j][0])
			lines.add((m, round(-1 * m * points[i][0] + points[i][1], 3)))

lines = list(lines)


m = {}

for i in lines:
	if i[0] in m:
		m[i[0]] += 1
	else:
		m[i[0]] = 1
# print(m)

count = 0

m_ = sum(m.values())
count = m_*(m_ - 1)//2

for i in m:
	count -= m[i]*(m[i] - 1)//2



print(count)

#CODE ENDS HERE....................

#stdout.close()