#![allow(non_snake_case, unused_imports)] use std::io::{self, prelude::*}; use std::str; fn gcd(a: usize, b: usize) -> usize { if a < b { return gcd(b, a); } if b == 0 { return a; } else { return gcd(b, a % b); } } fn main() { let (stdin, stdout) = (io::stdin(), io::stdout()); let mut scan = Scanner::new(stdin.lock()); let mut out = io::BufWriter::new(stdout.lock()); macro_rules! input { ($T: ty) => { scan.token::<$T>() }; } let N = input!(usize); let mut XY = vec![]; for _ in 0..N { let (x, y) = (input!(isize), input!(isize)); XY.push((x, y)); } let mut ans = 0; for i in 0..N { let (x1, y1) = XY[i]; let mut S = std::collections::BTreeSet::new(); for j in 0..N { if i == j { continue; } let (x2, y2) = XY[j]; let (mut dx, mut dy) = (x1 - x2, y1 - y2); let (gx, gy) = (dx.abs() as usize, dy.abs() as usize); let g = gcd(gx, gy) as isize; dx /= g; dy /= g; if S.contains(&(dx, dy)) { ans += 1; break; } S.insert((dx, dy)); } } writeln!(out, "{}", ans); } struct Scanner { reader: R, buf_str: Vec, buf_iter: str::SplitWhitespace<'static>, } impl Scanner { fn new(reader: R) -> Self { Self { reader, buf_str: vec![], buf_iter: "".split_whitespace(), } } fn token(&mut self) -> T { loop { if let Some(token) = self.buf_iter.next() { return token.parse().ok().expect("Failed parse"); } self.buf_str.clear(); self.reader .read_until(b'\n', &mut self.buf_str) .expect("Failed read"); self.buf_iter = unsafe { let slice = str::from_utf8_unchecked(&self.buf_str); std::mem::transmute(slice.split_whitespace()) } } } }