#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int x[300], y[300];
  int mas[1005000];
  int i, j, k;
  for (i = 1; i <= n; ++i) mas[i] = 1;
  for (i = 0; i < m; ++i) scanf("%d%d", &x[i], &y[i]);
  long long x1, x2, x3, jisdrgr, dsrjkfg, res = 0;
  for (i = 0; i < m; ++i)
    for (j = i + 1; j < m; ++j) {
      if (y[i] > y[j]) {
        jisdrgr = y[i];
        x1 = x[i];
        dsrjkfg = y[j];
        x2 = x[j];
      } else {
        dsrjkfg = y[i];
        x2 = x[i];
        jisdrgr = y[j];
        x1 = x[j];
      }
      if (jisdrgr == dsrjkfg) continue;
      long double tx =
          x1 + ((x2 - x1) * jisdrgr) / (long double)(jisdrgr - dsrjkfg);
      if (((tx - (long long)tx) < 0 ? (-(tx - (long long)tx))
                                    : (tx - (long long)tx)) < 0.000001) {
        x3 = (long long)tx;
        if (x3 >= 1 && x3 <= n) {
          int r = 0;
          for (k = 0; k < m; ++k)
            if (jisdrgr * (x[k] - x3) == y[k] * (x1 - x3)) ++r;
          if (mas[x3] < r) mas[x3] = r;
        }
      }
    }
  for (i = 1; i <= n; ++i) {
    res += mas[i];
  }
  cout << res;
  return 0;
}
