private static int check(ArrayList<Point> P) {
    int max_count = 0;
    for (int i = 0; i < P.size(); ++i) {
      for (int j = i + 1; j < P.size(); ++j) {
        int count = 2;
        Line temp = new Line(P.get(i), P.get(j));
        for (int k = j + 1; k < P.size(); ++k) {
          if (new Line(P.get(i), P.get(k)).equals(temp)) {
            ++count;
          }
        }
        max_count = Math.max(max_count, count);
      }
    }

    return max_count;
  }