#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
  point(long long x = 0, long long y = 0) {
    this->x = x;
    this->y = y;
  }
} a[255];
struct line {
  long long a, b, c;
  point A, B;
  line(long long a, long long b, long long c) : a(a), b(b), c(c) {}
  line(point A, point B) : A(A), B(B) {
    a = B.y - A.y;
    b = A.x - B.x;
    c = -(a * A.x + b * A.y);
  }
};
struct vecto {
  long long x, y;
  vecto(long long x = 0, long long y = 0) {
    this->x = x;
    this->y = y;
  }
  bool operator==(vecto& v) { return v.x == x && v.y == y; }
  bool operator<(const vecto& v) const {
    if (v.x == x) return y < v.y;
    return x < v.x;
  }
};
vecto toVec(point a, point b) { return vecto(b.x - a.x, b.y - a.y); }
long long crossProduct(vecto a, vecto b) { return a.x * b.y - a.y * b.x; }
int res[1000010];
int n, m;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = (1); i <= (m); i++) cin >> a[i].x >> a[i].y;
  for (int i = (1); i <= (n); i++) res[i] = 1;
  for (int i = (1); i <= (m); i++)
    for (int j = (i + 1); j <= (m); j++) {
      line l = line(a[i], a[j]);
      vecto v = toVec(a[i], a[j]);
      int cnt = 2;
      for (int k = (1); k <= (m); k++)
        if (k != i && k != j && crossProduct(v, toVec(a[i], a[k])) == 0) cnt++;
      if (l.a == 0) continue;
      if (l.c % l.a) continue;
      long long x = -l.c / l.a;
      if (x >= 1 && x <= n) res[x] = max(res[x], cnt);
    }
  int kq = 0;
  for (int i = (1); i <= (n); i++) kq += res[i];
  cout << kq;
  return 0;
}
