#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y;
  void input() { scanf("%d%d", &x, &y); }
} p[300];
int mv[1000010];
bool Line(int i, int j, int k) {
  return (long long)(p[j].x - p[i].x) * (p[k].y - p[i].y) ==
         (long long)(p[j].y - p[i].y) * (p[k].x - p[i].x);
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 1; i <= n; ++i) mv[i] = 1;
    for (int i = 0; i < m; ++i) p[i].input();
    for (int i = 0; i < m; ++i)
      for (int j = i + 1; j < m; ++j)
        if (p[i].y != p[j].y) {
          int cnt = 2;
          for (int k = 0; k < m; ++k)
            if (i != k && j != k && Line(i, j, k)) ++cnt;
          long long A = (long long)p[i].x * p[j].y - (long long)p[i].y * p[j].x,
                    B = p[j].y - p[i].y;
          if (B < 0) A = -A, B = -B;
          if (A % B) continue;
          long long x = A / B;
          if (x >= 1 && x <= n) mv[x] = max(mv[x], cnt);
        }
    int ans = 0;
    for (int i = 1; i <= n; ++i) ans += mv[i];
    printf("%d\n", ans);
  }
  return 0;
}
