const main = arg => {
  const input = arg.trim().split('\n');
  const abList = input.slice(1).map(l => l.split(' ').map(x => Number(x)));

  console.log(abList.reduce(
    (accumulator, [a, b], index) =>
      accumulator + abList.slice(index + 1).filter(([aa, bb]) => a * aa + b * bb !== 0).length + 1,
    0,
  ));
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
