#誤差ゲーで余りにも虚無なので多分そもそもの解法が間違っている. import math import bisect tiny = 0.00000001 n = int(input()) a = [] for i in range(n): x, y = map(float, input().split()) tmp = math.atan2(y, x) if tmp < 0 : tmp = 2*math.pi+tmp a.append(tmp / math.pi * 180) a.sort() print(a) ans = 0 for i in range(n): for j in range(i+1, n): if abs(a[i]-a[j])= 360 : g -= 360; if abs(g+360-f-diff) < tiny: ans += n - bisect.bisect_right(a,f) ans += bisect.bisect_left(a,g) else: f,g = g,f ans += bisect.bisect_left(a,g)-bisect.bisect_right(a,f) elif f >= 360 and g >= 360: f -= 360 g -= 360 ans += bisect.bisect_left(a,g)-bisect.bisect_right(a,f) print(ans//3)