#include <bits/stdc++.h>
using namespace std;
struct note {
  long long x, y;
} a[255];
int f[1000005];
bool b[255];
long long xot(long long x1, long long y1, long long x2, long long y2) {
  return x1 * y2 - x2 * y1;
}
bool check(note A, note B, note C) {
  return xot(B.x - A.x, B.y - A.y, C.x - A.x, C.y - A.y) == 0;
}
long long solve(note A, note B) {
  long long x = xot(A.x, A.y, B.x, B.y);
  if (A.y == B.y || x % (B.y - A.y)) return 0;
  return x / (B.y - A.y);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) f[i] = 1;
  for (int i = 1; i <= m; i++) scanf("%I64d %I64d", &a[i].x, &a[i].y);
  for (int i = 1; i <= m; i++) {
    memset(b, 0, sizeof(b));
    for (int j = i + 1; j <= m; j++)
      if (!b[j]) {
        long long z = solve(a[i], a[j]);
        b[j] = 1;
        if (z > 0 && z <= n) {
          int cnt = 2;
          for (int k = j + 1; k <= m; k++)
            if (!b[k] && check(a[i], a[j], a[k])) b[k] = 1, cnt++;
          f[z] = max(f[z], cnt);
        }
      }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += f[i];
  printf("%I64d\n", ans);
  return 0;
}
