#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void si(T &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c<48 | c> 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
void io() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
const int N = 1e6 + 6;
pair<long long, long long> point[255];
map<pair<long long, long long>, int> bb[N];
int Map[260 * 260];
int main() {
  for (int i = 1; i <= 250; i++) {
    Map[i * (i - 1) / 2] = i;
  }
  int n, m;
  si(n);
  si(m);
  for (int i = 0; i < m; i++) {
    scanf("%lld %lld", &point[i].first, &point[i].second);
  }
  for (int i = 0; i < m; i++) {
    for (int j = i + 1; j < m; j++) {
      long long y = point[i].second - point[j].second;
      if (y == 0) continue;
      if (((point[i].first - point[j].first) * point[i].second) % (y) == 0) {
        long long x = point[i].first -
                      ((point[i].first - point[j].first) * point[i].second) / y;
        if (x >= 1 && x <= n) {
          long long dx = point[i].first - point[j].first;
          long long dy = point[i].second - point[j].second;
          long long g = gcd(dy, dx);
          dx /= g, dy /= g;
          if (dx * dy < 0) {
            dx = abs(dx);
            dy = -abs(dy);
          }
          bb[x][make_pair(dy, dx)]++;
        }
      }
    }
  }
  int Sum = 0;
  for (int i = 1; i <= n; i++) {
    map<pair<long long, long long>, int>::iterator it = bb[i].begin();
    int iM = 1;
    for (; it != bb[i].end(); it++) {
      iM = ((iM) > (Map[it->second]) ? (iM) : (Map[it->second]));
    }
    Sum += iM;
  }
  printf("%d\n", Sum);
}
