N = int(input())
A = []
B = []
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
cou = 0

for i in range(N):
    if A[i]>1000000000:
        x1 = A[i]/1000000000
    else:
        x1 = A[i]
    if B[i]>1000000000:
        y1 = B[i]/1000000000
    else:
        y1 = B[i]
        
    for j in range(N):
        if A[j]>1000000000:
            x2 = A[j]/1000000000
        else:
            x2 = A[j]
        if B[i]>1000000000:
            y2 = B[j]/1000000000
        else:
            y2 = B[j]
        
        if not x1*x2+y1+y2 ==0:
            cou+=1

print(cou/1000000007)            
            
