#include <bits/stdc++.h>
long long map[1000008];
int x[255], y[255];
long long sum;
int main() {
  int m, n, i, j, k;
  long long a, b, tar, x1, y1, num;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i <= n; i++) map[i] = 1;
    for (i = 0; i < m; i++) scanf("%d%d", &x[i], &y[i]);
    for (i = 0; i < m; i++)
      for (j = i + 1; j < m; j++) {
        a = x[j] - x[i];
        b = y[j] - y[i];
        if (b == 0) continue;
        tar = x[i] - a * y[i] / b;
        if (tar * b != (b * x[i] - a * y[i]) || tar <= 0 || tar > n) continue;
        num = 2;
        for (k = j + 1; k < m; k++) {
          x1 = x[k] - x[j];
          y1 = y[k] - y[j];
          if (a * y1 == b * x1) num++;
        }
        map[tar] = map[tar] > num ? map[tar] : num;
      }
    sum = 0;
    for (i = 1; i <= n; i++) sum += map[i];
    printf("%lld\n", sum);
  }
  return 0;
}
