#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
inline pair<int, int> operator-(const pair<int, int> &a,
                                const pair<int, int> &b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
inline long long vec(const pair<int, int> &a, const pair<int, int> &b) {
  return (long long)a.first * b.second - (long long)b.first * a.second;
}
int a, b, c, d, i, j, n, m, k;
int ans[1000002];
pair<int, int> mas[251];
int main() {
  scanf("%d%d", &n, &m);
  for (int _n((n)), i(1); i <= _n; i++) ans[i] = 1;
  for (int _n((m)-1), i(0); i <= _n; i++) {
    scanf("%d%d", &mas[i].first, &mas[i].second);
  }
  for (int _n((m)-1), i(0); i <= _n; i++) {
    for (int _n((i)-1), j(0); j <= _n; j++) {
      long long ch = (long long)mas[i].second * (mas[j].first - mas[i].first);
      long long zn = mas[j].second - mas[i].second;
      if (!zn || ch % zn) continue;
      ch = -ch / zn + mas[i].first;
      if (ch < 1 || ch > n) continue;
      c = 0;
      for (int _n((m)-1), z(0); z <= _n; z++) {
        if (vec(mas[i] - mas[z], mas[j] - mas[z]) == 0) ++c;
      }
      ans[ch] = max(ans[ch], c);
    }
  }
  c = 0;
  for (int _n((n)), i(1); i <= _n; i++) c += ans[i];
  printf("%d\n", c);
}
