#include <bits/stdc++.h>
using namespace std;
int n, m;
long long int x[300], y[300];
int ans[1000087];
int cnt[1000087];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> x[i] >> y[i];
  for (int p = 1; p <= n; p++) ans[p] = 1;
  for (int i = 0; i < m; i++) {
    for (int p = 1; p <= n; p++) cnt[p] = 1;
    for (int j = i + 1; j < m; j++) {
      if (y[i] == y[j]) continue;
      long long int tmp = x[j] * y[i] - x[i] * y[j];
      if (tmp % (y[i] - y[j]) == 0) {
        tmp = tmp / (y[i] - y[j]);
        if (tmp >= 1 && tmp <= n) {
          cnt[tmp]++;
          ans[tmp] = max(ans[tmp], cnt[tmp]);
        }
      }
    }
  }
  int duck = 0;
  for (int p = 1; p <= n; p++) duck += ans[p];
  cout << duck << endl;
}
