n = int(input()) P = [] for _ in range(n): a, b, c, d = map(int, input().split()) P.append((a, b)) P.append((c, d)) ans = 0 m = 2 * n for i in range(m): x1, y1 = P[i] for j in range(i + 1, m): x2, y2 = P[j] if x1 == x2 and y1 == y2: continue res = 0 for i in range(0, m, 2): a, b = P[i] c, d = P[i + 1] e1 = (x2 - x1) * (b - y1) - (y2 - y1) * (a - x1) e2 = (x2 - x1) * (d - y1) - (y2 - y1) * (c - x1) if e1 * e2 <= 0: res += 1 ans = max(ans, res) print(ans)