#define _USE_MATH_DEFINES #include using namespace std; const long double esp = 1e-12; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector v; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; int g = __gcd(abs(x), abs(y)); x /= g; y /= g; v.push_back(atan2(x, y)); v.push_back(v.back() + M_PI * 2); v.push_back(v.back() + M_PI * 2); } sort(v.begin(), v.end()); long long ans = 0; for (int i = 0; i < n; i++) { int j = i; while (v[j] - v[i] <= M_PI + esp) j++; int k = j; for (int c = i + 1; c < j; c++) { if (v[i] == v[c]) continue; if (v[c] - v[i] >= M_PI - esp) break; while (v[k] - v[c] < M_PI - esp) k++; ans += k - j; } } cout << ans / 3 << endl; return 0; }