#include <bits/stdc++.h>
using namespace std;
const int N = 300 + 9;
const int M = 1e6 + 9;
struct Point {
  long long x, y;
} p[N];
long long cross(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
int ans[M];
int n, m;
int solve(Point a, Point b) {
  int res = 0;
  for (int i = 1; i <= m; ++i) {
    if (cross(a, b, p[i]) == 0) ++res;
  }
  return res;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%lld %lld", &p[i].x, &p[i].y);
  }
  for (int i = 1; i <= n; ++i) ans[i] = 1;
  for (int i = 1; i <= m; ++i) {
    for (int j = i + 1; j <= m; ++j) {
      double ox;
      int xx;
      if (p[j].y == p[i].y) continue;
      if (p[j].x != p[i].x) {
        double k = 1.0 * (p[j].y - p[i].y) / (p[j].x - p[i].x);
        double b = p[i].y - k * p[i].x;
        ox = -b / k;
        xx = ox + 0.5;
      } else
        xx = ox = p[i].x;
      if (fabs(ox - xx) > 1e-6 || xx < 1 || xx > n) continue;
      if (cross(p[i], p[j], (Point){xx, 0}) != 0) continue;
      int tem = solve(p[i], p[j]);
      ans[xx] = max(ans[xx], tem);
    }
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) res += ans[i];
  printf("%d", res);
  return 0;
}
