#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long x[255], y[255];
map<long long, map<double, set<pair<long long, long long>>>> mp;
int ans[1000005];
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < (int)(m); (i)++) {
    scanf("%lld%lld", x + i, y + i);
    if (x[i] >= 1 && x[i] <= n) ans[x[i]]++;
  }
  for (int(i) = 0; (i) < (int)(m); (i)++)
    for (int j = i + 1; j < m; j++)
      if (y[i] != y[j] && x[i] != x[j]) {
        long long a = x[j] * y[i] - x[i] * y[j];
        long long b = y[i] - y[j];
        if (((a > 0 && b > 0) || (a < 0 && b < 0)) && a % b == 0) {
          long long ii = a / b;
          if (ii < 1 || ii > n) continue;
          double k = 1.0 * (y[i] - y[j]) / (x[i] - x[j]);
          mp[ii][k].insert({x[i], y[i]});
          mp[ii][k].insert({x[j], y[j]});
        }
      }
  long long aa = 0;
  for (int i = 1; i <= n; i++) {
    int tmp = max(1, ans[i]);
    if (mp.find(i) != mp.end()) {
      for (auto p : mp[i]) {
        tmp = max(tmp, (int)p.second.size());
      }
    }
    aa += tmp;
  }
  printf("%lld\n", aa);
  return 0;
}
