#include <bits/stdc++.h>
using namespace std;
template <class T>
struct point {
  T x, y;
  point operator-(const point &a) const { return (point){x - a.x, y - a.y}; }
};
template <class T>
T cross(const point<T> &a, const point<T> &b) {
  return a.x * b.y - a.y * b.x;
}
enum { CCW = 1, CW = -1, ON = 0 };
template <class T>
int ccw(const point<T> &a, const point<T> &b, const point<T> &c) {
  T rdir = cross(b - a, c - a);
  if (rdir > 0) return CCW;
  if (rdir < 0) return CW;
  return ON;
}
int main() {
  int n, m;
  cin >> n >> m;
  point<long long> p[250];
  for (int i = 0; i < (m); i++) cin >> p[i].x >> p[i].y;
  static int ans[1000001];
  for (int x = 1; x <= n; x++) ans[x] = 1;
  for (int i = 0; i < (m); i++)
    for (int j = 0; j < (i); j++) {
      long long x1 = p[i].x, y1 = p[i].y;
      long long x2 = p[j].x, y2 = p[j].y;
      if (y1 != y2 && (x2 - x1) * y1 % (y2 - y1) == 0) {
        long long x0 = x1 - (x2 - x1) * y1 / (y2 - y1);
        if (1 <= x0 && x0 <= n) {
          int cnt = 0;
          for (int k = 0; k < (m); k++)
            if (ccw(p[i], p[j], p[k]) == ON) cnt++;
          ans[x0] = max(ans[x0], cnt);
        }
      }
    }
  cout << accumulate(ans + 1, ans + n + 1, 0LL) << endl;
  return 0;
}
