#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
using namespace std;
using lli = long long;
using ld = long long;
using ii = pair<int, int>;
using vi = vector<int>;
const ld eps = 1e-9;
enum { ON = -1, OUT, IN, OVERLAP, INF };
int sgn(ld a) { return (a > eps) - (a < -eps); }
struct Pt {
  ld x, y;
  explicit Pt(ld x = 0, ld y = 0) : x(x), y(y) {}
  Pt operator+(Pt p) const { return Pt(x + p.x, y + p.y); }
  Pt operator-(Pt p) const { return Pt(x - p.x, y - p.y); }
  Pt operator*(ld k) const { return Pt(x * k, y * k); }
  Pt operator/(ld k) const { return Pt(x / k, y / k); }
  ld dot(Pt p) const { return x * p.x + y * p.y; }
  ld cross(Pt p) const { return x * p.y - y * p.x; }
  ld norm() const { return x * x + y * y; }
  ld length() const { return sqrtl(norm()); }
  ld angle() const {
    ld ang = atan2(y, x);
    return ang + (ang < 0 ? 2 * acos(-1) : 0);
  }
  Pt perp() const { return Pt(-y, x); }
  Pt unit() const { return (*this) / length(); }
  Pt rotate(ld angle) const {
    return Pt(x * cos(angle) - y * sin(angle), x * sin(angle) + y * cos(angle));
  }
  int dir(Pt a, Pt b) const { return sgn((a - *this).cross(b - *this)); }
  int cuad() const {
    if (x > 0 && y >= 0) return 0;
    if (x <= 0 && y > 0) return 1;
    if (x < 0 && y <= 0) return 2;
    if (x >= 0 && y < 0) return 3;
    return -1;
  }
  bool operator==(Pt p) const {
    return (abs((x) - (p.x)) <= +eps) && (abs((y) - (p.y)) <= +eps);
  }
  bool operator!=(Pt p) const {
    return (!(abs((x) - (p.x)) <= +eps)) || (!(abs((y) - (p.y)) <= +eps));
  }
  friend ostream &operator<<(ostream &os, const Pt &p) {
    return os << "(" << p.x << ", " << p.y << ")";
  }
  void read() {
    lli x, y;
    cin >> x >> y;
    *this = Pt(x, y);
  }
};
const int N = 1e6 + 5, M = 255;
Pt flamingo[M];
int ans[N];
int n, m;
int main() {
  cin.tie(0)->sync_with_stdio(0), cout.tie(0);
  while (cin >> n >> m) {
    for (auto x = (1) - ((1) > (n + 1)); x != (n + 1) - ((1) > (n + 1));
         x += 1 - 2 * ((1) > (n + 1)))
      ans[x] = 1;
    for (auto i = (0) - ((0) > (m)); i != (m) - ((0) > (m));
         i += 1 - 2 * ((0) > (m)))
      flamingo[i].read();
    for (auto i = (0) - ((0) > (m)); i != (m) - ((0) > (m));
         i += 1 - 2 * ((0) > (m)))
      for (auto j = (i + 1) - ((i + 1) > (m)); j != (m) - ((i + 1) > (m));
           j += 1 - 2 * ((i + 1) > (m))) {
        if (flamingo[i].y == flamingo[j].y) continue;
        lli dx = flamingo[j].x - flamingo[i].x;
        lli dy = flamingo[j].y - flamingo[i].y;
        if (abs(flamingo[i].y * dx) % abs(dy) != 0) continue;
        lli x = flamingo[i].x - flamingo[i].y * dx / dy;
        if (x < 1 || x > n) continue;
        int cnt = 0;
        for (auto k = (0) - ((0) > (m)); k != (m) - ((0) > (m));
             k += 1 - 2 * ((0) > (m))) {
          auto dir =
              (flamingo[j] - flamingo[i]).cross(flamingo[k] - flamingo[i]);
          if ((abs((dir) - (0)) <= +eps)) cnt++;
        }
        ans[x] = max(ans[x], cnt);
      }
    cout << accumulate(ans + 1, ans + n + 1, 0LL) << '\n';
  }
  return 0;
}
