#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 4;
const double eps = 1e-10;
const int maxn = 1000;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
int sum[1000000 + 5];
bool vis[255];
int n, m;
struct line {
  long long a, b, c;
};
struct point {
  long long x, y;
} target[255];
line makeline(point a, point b) {
  line l;
  l.a = b.y - a.y;
  l.b = a.x - b.x;
  l.c = a.y * b.x - a.x * b.y;
  return l;
}
int cross(line l) {
  if (l.a == 0) return -1;
  if (l.c % l.a != 0) return -1;
  long long ret = -l.c / l.a;
  if (ret > 0 && ret <= n)
    return ret;
  else
    return -1;
}
bool online(line l, point a) {
  if (l.a * a.x + l.b * a.y + l.c == 0)
    return true;
  else
    return false;
}
int main() {
  memset(sum, 0, sizeof sum);
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%lld %lld", &target[i].x, &target[i].y);
  for (int i = 0; i < m - 1; i++) {
    memset(vis, 0, sizeof vis);
    for (int j = i + 1; j < m; j++) {
      if (!vis[j]) {
        vis[j] = 1;
        line l = makeline(target[i], target[j]);
        int cnt = 2;
        bool flag = true;
        for (int k = 0; k < i; k++)
          if (online(l, target[k])) {
            flag = false;
            break;
          }
        for (int k = j + 1; k < m; k++)
          if (online(l, target[k])) {
            cnt++;
            vis[k] = 1;
          }
        int ret = cross(l);
        if (flag && ret != -1) sum[ret] = max(sum[ret], cnt);
      } else
        continue;
    }
  }
  int rst = 0;
  for (int i = 1; i <= n; i++) rst += (sum[i] ? sum[i] : 1);
  printf("%d\n", rst);
  return 0;
}
