#include <bits/stdc++.h>
int main(void) {
  long long int n;
  long long int a[1000000];
  long long int b[1000000];
  long long int result;
  scanf("%lld %lld", &n);
  for (long long int i = 1; i <= n; i++) {
    scanf("%lld %lld", &a[i], &b[i]);
  }
  result = n * (n - 1) / 2;
  for (long long int i = 1; i <= n - 1; i++) {
    for (long long int j = i + 1; j <= n; j++) {
      if (a[i] * a[j] + b[i] * b[j] == 0) {
        result = result - 1;
        break;
      }
    }
  }
  printf("%lld\n", result % 1000000007);
  return 0;
}
