#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> A(N);
  vector<int64_t> B(N);
  int64_t count = 0;
  int64_t C = N + N * (N - 1) / 2;
  for (int i = 0; i < N; i++) {
    cin >> A.at(i) >> B.at(i);
  }
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A.at(i) * A.at(j) + B.at(i) * B.at(j) == 0) {
        int64_t count = count + 1;
      }
    }
  }
  cout << (C - count) % 1000000007;
}
