#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
int n;
int m;
long long x[250], y[250];
int ans[1000001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (m); i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < (n); i++) ans[i + 1] = 1;
  for (int i = 0; i < (m); i++) {
    for (int j = i + 1; j < m; j++) {
      if (y[j] == y[i]) continue;
      if (abs(y[i] * (x[j] - x[i])) % abs(y[j] - y[i]) != 0) continue;
      long long xx = x[i] - y[i] * (x[j] - x[i]) / (y[j] - y[i]);
      if (xx < 1 || xx > n) continue;
      int res = 0;
      for (int k = 0; k < (m); k++) {
        if ((x[i] - x[k]) * (y[j] - y[k]) - (x[j] - x[k]) * (y[i] - y[k]) == 0)
          res++;
      }
      ans[xx] = max(ans[xx], res);
    }
  }
  int res = 0;
  for (int i = 0; i < (n); i++) res += ans[i + 1];
  cout << res << endl;
  return 0;
}
